Suppress system gesture detection during streaming

This commit is contained in:
Cameron Gutman 2017-09-15 00:30:51 -07:00
parent 86f7112789
commit d0d60b8ffc
4 changed files with 38 additions and 0 deletions

View File

@ -610,6 +610,9 @@ static NSMutableSet* hostList;
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
{ {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
[[self revealViewController] setPrimaryViewController:self];
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
// Hide 1px border line // Hide 1px border line

View File

@ -180,6 +180,8 @@ typedef NS_ENUM(NSInteger, SWRevealToggleAnimationType)
@interface SWRevealViewController : UIViewController @interface SWRevealViewController : UIViewController
- (void)setPrimaryViewController:(UIViewController*)viewController;
/* Basic API */ /* Basic API */
// Object instance init and rear view setting // Object instance init and rear view setting

View File

@ -583,6 +583,7 @@ static CGFloat scaledValue( CGFloat v1, CGFloat min2, CGFloat max2, CGFloat min1
FrontViewPosition _panInitialFrontPosition; FrontViewPosition _panInitialFrontPosition;
NSMutableArray *_animationQueue; NSMutableArray *_animationQueue;
BOOL _userInteractionStore; BOOL _userInteractionStore;
UIViewController *_primaryViewController;
} }
const int FrontViewPositionNone = 0xff; const int FrontViewPositionNone = 0xff;
@ -1364,6 +1365,26 @@ const int FrontViewPositionNone = 0xff;
_enqueue( [theSelf _performTransitionOperation:operation withViewController:newViewController animated:animated] ); _enqueue( [theSelf _performTransitionOperation:operation withViewController:newViewController animated:animated] );
} }
- (void)setPrimaryViewController:(UIViewController*)viewController
{
_primaryViewController = viewController;
// These are derived from the primary view controller
if (@available(iOS 11.0, *)) {
[self setNeedsUpdateOfHomeIndicatorAutoHidden];
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
}
- (UIViewController*)childViewControllerForHomeIndicatorAutoHidden
{
return _primaryViewController;
}
- (UIViewController*)childViewControllerForScreenEdgesDeferringSystemGestures
{
return _primaryViewController;
}
#pragma mark Animated view controller deployment and layout #pragma mark Animated view controller deployment and layout

View File

@ -21,6 +21,13 @@
StreamManager *_streamMan; StreamManager *_streamMan;
} }
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[[self revealViewController] setPrimaryViewController:self];
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
@ -146,6 +153,11 @@
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
// Require a confirmation when streaming to activate a system gesture
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
return UIRectEdgeAll;
}
- (BOOL)shouldAutorotate { - (BOOL)shouldAutorotate {
return YES; return YES;
} }