Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- extension UIView {
- static func loadFromXib() -> UIView? {
- let bundle = Bundle(for: self)
- let nib = UINib(nibName: String(describing: self), bundle: bundle)
- let view = nib.instantiate(withOwner: self, options: nil).first as? UIView
- return view
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement