Problems with SFSafariViewController

As part of the ATS IOS 9 changes, I am updating the application to use SFSafariViewController for third-party http sites.

When I start and present an instance, all I get is an empty white view. No navigation bar, no content. This happens on both devices (iOS 9.1) and the simulator (iOS 9.1). However, on the device, I get the following debugger message after a minute or so:

Failed to get remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}

The app correctly includes the SafariServices infrastructure. I created a test project to make sure my SDK installation was to blame, but this project works just fine.

I requested support through the Apple Developer Portal and posted this on the Apple Developer Forums. Has anyone understood what it is or how to solve it?

+4
source share
2 answers

Technical support for Apple Developer came back to me with the following:

There is an error in the toolbar class used by the Safari view controller, which forces it to constantly execute the layout (essentially in an infinite loop) if it or any of its panel buttons have a background image is applied through the appearance proxy.

As a workaround, you will need to remove the line of code or restrict the appearance setting to instances in which the UIBarButtonItem is contained in your own view controller (you may need to subclass the UINavigationController so that you can target your subclass with [UIBarButtonItem occurrence of WhenContainedIn:]).

+2

, , SFVC, , , , initWithURL :

SFSafariViewController *sfvc = [[SFSafariViewController alloc]initWithURL:URL entersReaderIfAvailable:YES];
0

Source: https://habr.com/ru/post/1618084/


All Articles