I\'m using the code below to hide the home indicator on iPhone X, which is working fine in the emulator.
-(BOOL)prefersHomeIndicatorAutoHidden
{
return YES;
It is a choice between hidden and deferred but NOT both
-(BOOL)prefersHomeIndicatorAutoHidden
{
// YES for hidden (but swipe activated)
// NO for deferred (app gets priority gesture notification)
return NO;
}
register the gesture in viewDidLoad
UIScreenEdgePanGestureRecognizer *sePanGesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
sePanGesture.edges = UIRectEdgeAll;
// or just set the bottom if you prefer, top-right seems to behave well by default
[self.view addGestureRecognizer:sePanGesture];
and define the handleGesture, no need to do anything there for this to work
- (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)recognizer {
// to get location where the first touch occurred from docs
// CGPoint location = [recognizer locationInView:[recognizer.view superview]];
NSLog(@"gestured");
}
should be it