weixin_39651816
2021-01-08 11:01Forward UITextfield Delegate
I have added an optional delegate to QEntryTableViewCell called "ForwardedUITextFieldDelegate" this enhancement will allow controllers other than QEntryTableViewCell to respond to UITextfield delegate methods. An example where this may prove useful is performing an action when the "Done" button on they keyboard is clicked. In the sample the LoginController could respond to the delegate method
- (void)textField:(UITextField *)textField shouldReturn:(QEntryElement *)element {
if([element.key isEqualToString:@"password"]) {
[self onSignIn:element];
}
}
the textField parameter might prove to be irrelevant with the addition of the QEntryElement as a parameter, but I was trying to keep this delegate somewhat close to the UITextfield delegate. I added a forward delegate method for each of the delegate methods that are being used by QEntryTableViewCell, there are a few additional delegate that could be added but these might not be relevant in the context of QuickDialog.
该提问来源于开源项目:escoz/QuickDialog
- 点赞
- 回答
- 收藏
- 复制链接分享
11条回答
为你推荐
- 设置 UITextField 的最大字符长度
- cocoa
- ios
- uitextfield
- objective-c
- 0个回答
- Uitextfield 文本更改事件
- ios
- event-handling
- objective-c
- swift
- uitextfielddelegate
- 0个回答
- 使用 UITextBorderStyleNone 为 UITextField 设置填充
- iphone
- uitextfield
- objective-c
- padding
- 0个回答
- ios uitextfield从最开头输入太难看了
- ios
- 1个回答
- sender修改UITextField的值
- iphone
- ios
- objective-c
- 1个回答