Created
January 26, 2017 07:26
-
-
Save artemnovichkov/de92b678ec9ef336b78b18efaba353e0 to your computer and use it in GitHub Desktop.
NSViewController category for simple initialization from storyboard/nib.
This file contains 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
import AppKit | |
extension NSViewController { | |
static func load<T>() -> T where T: NSViewController { | |
return T(nibName: T.className(), bundle: nil)! | |
} | |
} | |
//Usage: | |
//let viewController: LoginViewController = .load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment