I was creating a Mac application using Swift. I have email as TextField and Password as SecureField. I need to get the email and password values that I entered after running the code.
Now i tried how
@IBOutlet var Email: NSTextField!
@IBOutlet var Password: NSSecureTextField!
@IBAction func signin(sender: AnyObject) {
println("Email is: \(Email.objectValue) and password is: \(Password.objectValue)")
}
He returns me the output as
Email is: Optional(yashwanthbabu.gujarathi@gmail.com) and password is Optional(password)
I need to get only values like
Email is: yashwanthbabu.gujarathi@gmail.com and Password is: password
I mean, I should not get "Optional" in the output.
source
share