Last active
May 7, 2019 01:30
-
-
Save moonvader/585bc83bc147408347aa0641cffdb35d to your computer and use it in GitHub Desktop.
iOS Login Screen Redirect in 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
func showLoginScreen() { | |
DispatchQueue.main.async { [weak self] in | |
guard let self = self else { return } | |
let frame = UIScreen.main.bounds | |
let window = UIWindow(frame: frame) | |
window.rootViewController = LoginViewController.instanceFromStoryboard(delegate: self) | |
window.makeKeyAndVisible() | |
window.alpha = 0 | |
UIView.animate(withDuration: 0.25) { | |
window.alpha = 1 | |
} | |
self.window = window | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment