I have a UIView
which draws a signature. The signature is inputed via a custom inputView on the signature view.
When drawing the signature view, I use the fact that it's the first responder to highlight the view as being edited, and I also override the resignFirstResponder
method to work out when to stop showing it as being edited.
So the code looks something like this:
@implementation SignatureView
-(BOOL) becomeFirstResponder {
BOOL result = [super becomeFirstResponder];
[self showEditingMode];
return result;
}
-(BOOL) resignFirstResponder {
BOOL result = [super resignFirstResponder];
[self showViewingMode];
return result;
}
-(UIView *) inputView {
if (!keyboard)
keyboard = [[SignatureKeyboardView alloc] initWithStuff:stuff....];
return keyboard;
}
@end
The problem I'm having is that on iOS 11, the resignFirstResponder
method is no longer getting called. On previous versions of iOS, it used to get called and I could then change the UI to show that it's no longer being edited.
This ONLY HAPPENS when the UIScrollView
is set to dismiss the keyboard when dragged, and the user drags the UIScrollView
.
If the user instead taps another UIView
that can become a first responder e.g. a UITextField
, then resignFirstResponder
gets called.
Am I missing something that changed in iOS11 or have I hit a bug?