Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import UIKit
  2.  
  3. extension UIView {
  4. static func loadFromXib() -> UIView? {
  5. let bundle = Bundle(for: self)
  6. let nib = UINib(nibName: String(describing: self), bundle: bundle)
  7. let view = nib.instantiate(withOwner: self, options: nil).first as? UIView
  8.  
  9. return view
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement