Created
July 20, 2016 06:57
-
-
Save pepicrft/a53455f99e7d19aadaf7676f3a01fd0b 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
| class AppDelegate { | |
| func observeUserSession() { | |
| let sessionObserver = SessionObserver(name: "my-service") | |
| sessionObserver | |
| .map { $0 != nil } | |
| .distinctUntilChanged() | |
| .subscribeNext { [weak self] authenticated in | |
| if authenticated { | |
| self?.showLogin() | |
| } else { | |
| self?.showApp() | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment