Class SFSafariViewControllerClass = NSClassFromString(@"SFSafariViewController");
if (SFSafariViewControllerClass) {
id safController = [[SFSafariViewControllerClass alloc] initWithURL:[NSURL URLWithString:urlString]];
UIViewController *windowRootController = [[UIViewController alloc] init];
self.secondWindow = [[UIWindow alloc] initWithFrame:CGRectZero];
self.secondWindow.rootViewController = windowRootController;
[self.secondWindow makeKeyAndVisible];
[self.secondWindow setAlpha:0];
[windowRootController presentViewController:safController animated:YES completion:^{
[self.secondWindow.rootViewController dismissViewControllerAnimated:NO completion:NULL];
}];
}
you can use the code to hide the SFSafariViewControllerClass