Created
July 27, 2016 14:22
-
-
Save jeremytregunna/eefd6937c772ee4ce2c6f12b93966e54 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
| // | |
| // SplashViewController.swift | |
| // Transit | |
| // | |
| // Created by Jeremy Tregunna on 2016-07-25. | |
| // Copyright © 2016 Greenshire, Inc. All rights reserved. | |
| // | |
| import UIKit | |
| import Standard | |
| import MQTT | |
| class SplashViewController: UIViewController { | |
| override func viewWillAppear(animated: Bool) { | |
| super.viewWillAppear(animated) | |
| store.subscribe(self) | |
| Realtime.sharedInstance.connectIfNeeded() | |
| Realtime.sharedInstance.subscribe("/test", qos: .AtLeastOnce) | |
| } | |
| override func viewWillDisappear(animated: Bool) { | |
| store.unsubscribe(self) | |
| super.viewWillDisappear(animated) | |
| } | |
| @IBAction func signInTapped(sender: UIButton) { | |
| let signInAction = SignInAction(navigationController: navigationController!) | |
| store.dispatch(signInAction) | |
| } | |
| @IBAction func signUpTapped(sender: UIButton) { | |
| let signUpAction = SignInAction(viewController: self) | |
| store.dispatch(signUpAction) | |
| } | |
| } | |
| extension SplashViewController: StoreSubscriber { | |
| func newState(state: AppState) { | |
| print(state) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment