I am creating a Share extension and faced with a strange behaviour during my tests on iOS 13.0 and later. I use UISwipeGestureRecognizer to interpret user's swiping gestures on the main view on my extension.
This simple code provides below as an example of that I want and works perfectly on 12.4 and older:
@interface ShareAndSwipeRootController ()
@end
@implementation ShareAndSwipeRootController
- (void)loadView {
[super loadView];
[self.view setBackgroundColor:[UIColor redColor]];
[self.view setUserInteractionEnabled:YES];
UISwipeGestureRecognizer *swipeUpGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUp:)];
swipeUpGestureRecognizer.direction = UISwipeGestureRecognizerDirectionUp;
[self.view addGestureRecognizer:swipeUpGestureRecognizer];
UISwipeGestureRecognizer *swipeDownGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDown:)];
swipeDownGestureRecognizer.direction = UISwipeGestureRecognizerDirectionDown;
[self.view addGestureRecognizer:swipeDownGestureRecognizer];
};
-(void) swipeUp:(UISwipeGestureRecognizer *)recognizer {
NSLog(@"SWIPE Up");
}
-(void) swipeDown:(UISwipeGestureRecognizer *)recognizer {
NSLog(@"SWIPE Down");
}
@end
On iOS 13.0 and newer it logs nothing. You might check the difference on iOS Simulator for corresponding versions.
Perhaps someone solved this problem and knows what is the reason or found its description - please share the result.
Thanks.