I'm trying to subclass UITextField in order to set the font correctly as per the answer to this question: Custom Font Sizing in XCode6 Size Classes Not Working Properly w/ Custom Fonts
I have a text field with a custom font and when I use size classes I lose ALL custom fonts in my app. They default to system.
I've tried to do the same thing for the UITextField as the answer to that question suggested for UILabel, but with no joy.
My Subclass:
import Foundation
import UIKit
class CustomUITextField: UITextField {
override func layoutSubviews() {
super.layoutSubviews()
self.font = UIFont(name: "Score Board", size: self.font!.pointSize)
}
}