Skip to content

Instantly share code, notes, and snippets.

@maximbilan
Created August 11, 2018 15:17
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 maximbilan/13ee42a21d97d9c50b0a2f340bd9ff5a to your computer and use it in GitHub Desktop.
Save maximbilan/13ee42a21d97d9c50b0a2f340bd9ff5a to your computer and use it in GitHub Desktop.
public extension UIView {
class func fromNib<T: UIView>() -> T {
return Bundle.main.loadNibNamed(String(describing: T.self), owner: nil, options: nil)![0] as! T
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment