Created
October 10, 2016 16:29
-
-
Save jimrutherford/ad5a51d71cee893c6a9286f9ffdcedb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@IBDesignable | |
public class MyCustomView: UIView { | |
override public init(frame: CGRect) { | |
super.init(frame: frame) | |
applyStyle() | |
} | |
required public init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
applyStyle() | |
} | |
override public func prepareForInterfaceBuilder() { | |
applyStyle() | |
} | |
func applyStyle() { | |
self.backgroundColor = .blueColor() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment