Skip to content

Instantly share code, notes, and snippets.

@jimrutherford
Created October 10, 2016 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimrutherford/ad5a51d71cee893c6a9286f9ffdcedb0 to your computer and use it in GitHub Desktop.
Save jimrutherford/ad5a51d71cee893c6a9286f9ffdcedb0 to your computer and use it in GitHub Desktop.
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