Created
October 18, 2017 13:46
-
-
Save dreampowder/5a5ba11aeeefe2b610c748ea6ec54851 to your computer and use it in GitHub Desktop.
Generic Load from nib swift
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
extension UIViewController { | |
class func loadFromNib<T: UIViewController>() -> T { | |
return T(nibName: String(describing: self), bundle: nil) | |
} | |
} | |
let vc : OfferDetailViewController = OfferDetailViewController.loadFromNib() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment