Created
July 29, 2017 20:01
-
-
Save efremidze/07e01e58825fe65741f090c8ac5f886f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol XibViewProtocol {} | |
extension XibViewProtocol where Self: UIView { | |
static func nib(_ name: String? = nil, owner: Any? = nil, bundle: Bundle = .framework) -> Self { | |
return bundle.loadNibNamed(name ?? String(describing: self), owner: owner, options: nil)!.first as! Self | |
} | |
} | |
extension UIView: XibViewProtocol {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment