텍스트 필드 변화 감지
@IBOutlet var myPhoneNumber: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
myPhoneNumber.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: .editingChanged)
}
func textFieldDidChange(textField: UITextField) {
print(myPhoneNumber.text!)
}
'iOS Swift' 카테고리의 다른 글
swift3 add touch event to uitextfield editingDidBegin/editingDidEnd (0) | 2017.01.02 |
---|---|
swift3 save image to UserDefaults (0) | 2017.01.02 |
resign keyboard textfield (0) | 2016.12.31 |
Swift3 UITextField border bottom (0) | 2016.12.31 |
swift3 : change button background color 버튼 배경색 변경하기 hex to UIColor (0) | 2016.12.13 |