【发布时间】:2016-01-04 14:49:23
【问题描述】:
我创建了一个名为 MyUILabel 的 UILabel 子类。唯一改变的是字体和字体大小。当我运行该应用程序时,它会按预期显示。但是,在情节提要中,会显示默认的 UILabel。有什么方法可以让 Storyboards 显示我的子类中的字体和字体大小?
MyUILabel:
public class MyUILabel : UILabel {
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.font = UIFont(name: Constants.DefaultFont, size: 30)
}
}
【问题讨论】:
标签: swift uikit interface-builder xcode-storyboard