Group outlets in a custom NSObject
suggest changeMove every outlet to an NSObject. Then drag an Object from the library to the controller scene of the storyboard, set its class to ContactFormStyle, and connect the elements there. The sample is Swift 2 (systemFontOfSize, blackColor()). A private outlet can be invisible to Interface Builder.
class ContactFormStyle: NSObject
{
@IBOutlet private weak var message: UILabel! {
didSet {
message.font = UIFont.systemFontOfSize(12)
message.textColor = UIColor.blackColor()
}
}
}
class ContactFormVC: UIViewController
{
@IBOutlet private var style: ContactFormStyle!
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents