Xcode 6 has a new feature where fonts and font sizes in UILabel, UITextField, and UIButton can be s
I am using Swift, XCode 6.4. So this is what I did
import Foundation
import UIKit
@IBDesignable class ExUILabel: UILabel {
@IBInspectable var fontName: String = "Default-Font" {
didSet {
self.font = UIFont(name: fontName, size:self.font.pointSize)
}
}
override func layoutSubviews() {
super.layoutSubviews()
self.font = UIFont(name: fontName, size:self.font.pointSize)
}
}
Goto Designer -> Identity Inspector -> Set the class to ExUILabel
Then go to Attribute inspector in designer and set the font name.