Last active
April 4, 2016 10:37
-
-
Save alexruperez/ab5e175d40413faea0a8 to your computer and use it in GitHub Desktop.
Revisions
-
alexruperez revised this gist
Feb 8, 2016 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // // ARSafariViewController.h // // Copyright © 2016 alexruperez. The MIT License (MIT) // @import SafariServices; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // // ARSafariViewController.m // // Copyright © 2016 alexruperez. The MIT License (MIT) // #import "ARSafariViewController.h" -
alexruperez created this gist
Feb 8, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ // // ARSafariViewController.h // // Copyright © 2016 alexruperez. All rights reserved. // @import SafariServices; @interface ARSafariViewController : SFSafariViewController @end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ // // ARSafariViewController.m // // Copyright © 2016 alexruperez. All rights reserved. // #import "ARSafariViewController.h" @interface ARSafariViewController () @property (nonatomic, assign) BOOL isSwipingBack; @end @implementation ARSafariViewController - (UIStatusBarStyle)preferredStatusBarStyle { if (self.isSwipingBack) { return [self.presentingViewController preferredStatusBarStyle]; } return [super preferredStatusBarStyle]; } - (BOOL)prefersStatusBarHidden { if (self.isSwipingBack) { return [self.presentingViewController prefersStatusBarHidden]; } return [super prefersStatusBarHidden]; } - (void)viewWillDisappear:(BOOL)animated { self.isSwipingBack = YES; [self.transitionCoordinator notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) { self.isSwipingBack = NO; }]; [super viewWillDisappear:animated]; } - (void)setIsSwipingBack:(BOOL)isSwipingBack { _isSwipingBack = isSwipingBack; [self setNeedsStatusBarAppearanceUpdate]; } @end