I have a class ASTextField which extends after UITextField and I want to define textFieldResponder.
Is any solution to write below line in Swift ??
UIResponder* nextResponder = [textField.superview viewWithTag:nextTag];
which has been written in Objective-C below?
-(BOOL)textFieldShouldReturn:(UITextField*)textField;
{
NSInteger nextTag = textField.tag + 1;
// Try to find next responder
UIResponder* nextResponder = [textField.superview viewWithTag:nextTag];
if (nextResponder) {
// Found next responder, so set it.
[nextResponder becomeFirstResponder];
} else {
// Not found, so remove keyboard.
[textField resignFirstResponder];
}
return NO; // We do not want UITextField to insert line-breaks.
}