Hello I'm developing project (finishing it in objective-c) but one class was writed in Swift. After migration to XCODE 7 for ios9 compiler back to me with Error: 'String?' is not convertible to 'NSString' for code:
if let view = self.emailTextField.rightView {
if (self.emailTextField.text as NSString).validateEmail() {
self.emailTextField.rightView?.alpha = 1
} else {
self.emailTextField.rightView?.alpha = 0
}
}
Any advice from Swift2 Bosses :) ?
Boss advice:
self.emailTextField.text as NSString
becomes self.emailTextField.text! as NSString
:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With