Skip to main content
added 541 characters in body
Source Link

Update

Turns out the old answer didn't work, it just worked since I put breakpoints. If I added a thread sleep seems it worked in XCode9, but that's not the best solution. Anyone have another better solution?

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { [NSThread sleepForTimeInterval:0.5f]; } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:NO completion:nil]; 

Old Answer

I have the same issue as genaks and tinkered around with SFViewController.

Seems like this code works for me

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; config.barCollapsingEnabled = NO; sfcontroller = [[SFSafariViewController alloc] initWithURL:url configuration: config]; } else { // Fallback on earlier versions } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:YES completion:nil]; 

In ios 11, they introduce SFSafariViewControllerConfiguration, and by default the barCollapsingEnabled is true and it seems the one that causing my blank SafariView. Hope this solves yours too

I have the same issue as genaks and tinkered around with SFViewController.

Seems like this code works for me

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; config.barCollapsingEnabled = NO; sfcontroller = [[SFSafariViewController alloc] initWithURL:url configuration: config]; } else { // Fallback on earlier versions } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:YES completion:nil]; 

In ios 11, they introduce SFSafariViewControllerConfiguration, and by default the barCollapsingEnabled is true and it seems the one that causing my blank SafariView. Hope this solves yours too

Update

Turns out the old answer didn't work, it just worked since I put breakpoints. If I added a thread sleep seems it worked in XCode9, but that's not the best solution. Anyone have another better solution?

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { [NSThread sleepForTimeInterval:0.5f]; } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:NO completion:nil]; 

Old Answer

I have the same issue as genaks and tinkered around with SFViewController.

Seems like this code works for me

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; config.barCollapsingEnabled = NO; sfcontroller = [[SFSafariViewController alloc] initWithURL:url configuration: config]; } else { // Fallback on earlier versions } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:YES completion:nil]; 

In ios 11, they introduce SFSafariViewControllerConfiguration, and by default the barCollapsingEnabled is true and it seems the one that causing my blank SafariView. Hope this solves yours too

Source Link

I have the same issue as genaks and tinkered around with SFViewController.

Seems like this code works for me

SFSafariViewController *sfcontroller = [[SFSafariViewController alloc] initWithURL:url]; if (@available(iOS 11.0, *)) { SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; config.barCollapsingEnabled = NO; sfcontroller = [[SFSafariViewController alloc] initWithURL:url configuration: config]; } else { // Fallback on earlier versions } sfcontroller.delegate = self; [controller presentViewController:sfcontroller animated:YES completion:nil]; 

In ios 11, they introduce SFSafariViewControllerConfiguration, and by default the barCollapsingEnabled is true and it seems the one that causing my blank SafariView. Hope this solves yours too