According to the UIKit diff document, in ios9/Swift 2
var text: String! has become var text: String?
According to the documentation
A simple way around this problem is to create an extension to UITextField and use that instead of the .text property.
extension UITextField {
var unwrappedText: String {
return self.text ?? ""
}
}
Now you can say textfield.unwrappedText without worrying about optionals. (Of course this is just for reading the value).