I had several cases where testers reported that the keyboard would disappear whenever they started typing in some fields in my app. I traced the flow using the simulator and while debugging on a phone and the problem didn't occur, ever. However, when I tried it on an untethered phone it happened fairly consistently.
Here's some pertinent code. All of this is to hide the keyboard when a user taps outside a textfield. My UIViews are subclasses of my Touchview class, which receives all touches:
TouchView.h:
@protocol TouchViewDelegate <NSObject>
-(UIView *) handleTouches:(NSSet *)touches withEvent:(UIEvent *)event inView:(UIView *) view;
@end
@interface TouchView : UIScrollView
@property (nonatomic, strong) id <TouchViewDelegate> touchDelegate;
@end
TouchView.m:
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView * touchedView = [super hitTest:point withEvent:event];
NSSet* touches = [event allTouches];
[self.touchDelegate handleTouches:touches withEvent:event inView:touchedView];
return touchedView;
}
I configured the main view as a Touchview and included this in the viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
HMWTouchView * touchView = (HMWTouchView*) self.view;
touchView.touchDelegate = self;
...
}
Here's an implementation of the delegate method:
-(UIView *) handleTouches:(NSSet *)touches withEvent:(UIEvent *)event inView:(UIView *) hitView {
if (![hitView isKindOfClass:[UIButton class]]) {
[[UIResponder firstResponder] resignFirstResponder];
}
return self.view;
}
This looks like it is at least a change in how IOS 8 responds to hits.