Last active
May 12, 2016 08:17
-
-
Save chris-pilcher/67f2a306315e3bbf6a40100884ce8968 to your computer and use it in GitHub Desktop.
LoginViewController for http://stackoverflow.com/questions/37179575/use-of-unresolved-identifier-self
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
import Cocoa | |
import AppKit | |
let CURRENT_USER: User? = User() | |
class User { | |
let authData: String? = "" | |
} | |
class LoginViewController: NSViewController { | |
@IBOutlet weak var logoutButton: NSButton! | |
@IBOutlet weak var emailTextField: NSTextField! | |
@IBOutlet weak var passwordTextField: NSSecureTextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
} | |
override func viewDidAppear() { | |
super.viewDidAppear() | |
if NSUserDefaults.standardUserDefaults().valueForKey("uid") != nil && CURRENT_USER!.authData != nil | |
{ | |
self.logoutButton.hidden = false | |
} | |
} | |
func loginAction(sender: AnyObject) | |
{ | |
let email = self.emailTextField.stringValue | |
let password = self.passwordTextField.stringValue | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment