Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func loginBtnTapped(sender: AnyObject) {
- let username = usernameTextField.text!
- let password = passwordTextField.text!
- _actionsCreator.login(username, password)
- }
- override func viewDidLoad() {
- super.viewDidLoad()
- FluxDispatcher.bind(
- self,
- eventType: UserStore.UserChangeEvent.LoggedIn,
- handler: onLoggedIn)
- }
- private func onLoggedIn(result: NSNotification!) {
- let message = "Welcome \(_userStore.user!.displayName)"
- let alert = UIAlertController(title: "Login", message: message, preferredStyle: UIAlertControllerStyle.Alert)
- alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
- self.presentViewController(alert, animated: true, completion: nil)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement