SFSafariViewController in iOS 9.2

After dismissing the SVC using the edge swipe gesture, the UI of my View Controller freezes and button touch event actions are not fired. Has anyone faced this problem?


P.S: Everything is working fine when I tap the Done button in SVC

Replies

I'm facing the same issue.


It seems when you swipe back slowly, everything works fine as it does when you hit the Done button.

It's only when you swipe back quickly that the UI become unresponsive though the events are actually firing.

It's as if an invisible VC is blocking any VC related execution. (I verified that the UI in the original VC are responding to touch inputs by logging the outputs.)


When I dismiss the SFSafariViewController via quick swiping back, the viewDidAppear() method in the presenting VC never gets called and the VC's presentedViewController property keeps reference to the dismissed SFSafariViewController.


According to this post, the issue is due to SFSafariViewController instance not being released properly but so far I could not find any way to force release this.

I suppose this is a bug?


I'd love to know too if there's any workaround to this…

I've seen similar behavior (though I had assumed that it was related to a UINavigationController subclass that I'm, ScrollingNavigationController). No solution yet, though - you find a workaround?

This is an issue. Verified today when updating to 9.2 release. Anyone find a workaround?

Encountered this problem today.

Not sure whether this occurs in pre-9.2 releases, will test it later.

And any suggestion to solve?

I put the Safari view controller in a navigation controller and then presented the nav controller. Doing that combined with a presentation style of UIModalPresentationOverFullScreen seems to disable the swipe gesture, which is one way to work around this problem.


safariController.modalPresentationStyle = UIModalPresentationOverFullScreen;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:safariController];
navController.navigationBarHidden = YES;

Same issue. This is definately a bug.

.I'm hitting this issue too. Has anyone found a solution?


I've filed a Radar on this: #24560676.

Here's a temporary workaround I'm using to disable the edge swipe gesture. It doesn't seem to be a problem as long as the Done button is used to dismiss.


let viewController = SFSafariViewController(URL: url)
presentViewController(viewController, animated: true) {

     for view in viewController.view.subviews {

          if let recognisers = view.gestureRecognizers {

               for gestureRecogniser in recognisers where gestureRecogniser is UIScreenEdgePanGestureRecognizer {

                    gestureRecogniser.enabled = false
               }
          }
     }
}