UiTextField events

后端 未结 3 722
后悔当初
后悔当初 2020-12-20 12:45

When I create UITextField inside Interface Builder, I can access Events tab for it, which has events like Value changed, Touch cancel, Touch drag, etc. I can assign my own m

3条回答
  •  感情败类
    2020-12-20 13:24

    Refer to Apple documentation for UIControl. After initializing your textField, call addTarget:action:forControlEvents:

    example for the touch event ending an edit session

    [textField addTarget:self action:@selector(handleTouchValueChanged:) forControlEvents: UIControlEventEditingDidEnd]
    

提交回复
热议问题