Skip to content

Instantly share code, notes, and snippets.

@clowestab
Created August 3, 2017 22:25
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 clowestab/2231826f0425969568b128b053bd8245 to your computer and use it in GitHub Desktop.
Save clowestab/2231826f0425969568b128b053bd8245 to your computer and use it in GitHub Desktop.
//Load a nib with a given name
class func loadFromNibNamed(nibNamed: String, bundle : NSBundle = NSBundle.mainBundle()) -> 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