Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexandreraulin/fb8cfbc1f932bb3b1ad5f04beaa571b7 to your computer and use it in GitHub Desktop.
Save alexandreraulin/fb8cfbc1f932bb3b1ad5f04beaa571b7 to your computer and use it in GitHub Desktop.
extension UIView {
class func loadFromNibNamed(nibNamed: String, bundle : NSBundle? = nil) -> UIView? {
return UINib(
nibName: nibNamed,
bundle: bundle
).instantiateWithOwner(nil, options: nil)[0] as? UIView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment