Skip to content

Instantly share code, notes, and snippets.

@leojkwan
Created July 16, 2018 22:01
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 leojkwan/f324239210058053945b4278b2b97c04 to your computer and use it in GitHub Desktop.
Save leojkwan/f324239210058053945b4278b2b97c04 to your computer and use it in GitHub Desktop.
class EmbeddableCustomView: UIView, HasNib {
override init(frame: CGRect) {
super.init(frame: frame)
// Render xib view from code.
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
// Render xib view from interface builder.
commonInit()
}
private func commonInit() {
// layout .xib view tree & activate layout constraints.
loadNibContent()
// Your setup code below.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment