Closed diegothucao closed 9 years ago
Put conditions just like sample code doing, and show popover where alert view is showing ( //Do your work on tapping textField.).
textFieldShouldBeginEditing is not existed in Swift
It exists, do you have any reference to point-out that textFieldShouldBeginEditing is not exist in swift?
func textFieldShouldBeginEditing(state: UITextField) -> Bool { return false }
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextFieldDelegate_Protocol/
@diegothucao you are approaching a Wrong delegate You are using UITextView
and tried to call the delegation of UITextField
but the correct method is,
@hardikdevios You are right! @diegothucao you are using wrong delegate method.
Thanks for you helps. I have done with it.
Thanks
Dear Friends, I want to show popover or customized Warring message when I click on a specific UITextView, I used:
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField { if (textField == customWorkTextField) { if (textField.isAskingCanBecomeFirstResponder == NO) { //Do your work on tapping textField. [[[UIAlertView alloc] initWithTitle:@"IQKeyboardManager" message:@"Do your custom work here" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; }
}
How to do in in Swift and iOS 8.4 ?
Thanks,
Thu