Я пытаюсь отключить кнопку продолжения, если в текстовом поле ничего нет. Вот мой код ...Как отключить кнопку, если текстовое поле пуст?
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var nounTextField: UITextField!
@IBOutlet weak var `continue`: UIButton!
var noun = String()
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func continueButton(sender: AnyObject) {
noun = nounTextField.text!
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let nvc = segue.destinationViewController as! ViewController2
nvc.noun2 = noun
}
}
Несвязанный, всегда вызывайте 'super' в' viewDidLoad'. – Rob