Created
November 17, 2015 13:38
-
-
Save kostiakoval/cbc57e7d9e82d42c9eee to your computer and use it in GitHub Desktop.
Init Functionality proposal for http://merowing.info/2015/11/swift-init/
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
class Foo2 { | |
let controller: UIViewController = Foo2.setupController() | |
let window: UIWindow = Foo2.setupWindow() | |
} | |
private extension Foo2 { | |
static func setupController() -> UIViewController { | |
return UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()! | |
} | |
static func setupWindow() -> UIWindow { | |
let window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
window.backgroundColor = UIColor.whiteColor() | |
window.makeKeyAndVisible() | |
return window | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment