SFSafariViewController is an empty view

Originator:calvin.cestari
Number:rdar://23781144 Date Originated:07-Dec-2015 12:56 PM
Status:Closed (duplicate of 23203352) Resolved:No
Product:iOS Product Version:9.1
Classification: Reproducible:Yes
 
Summary:
The SFSafariViewController instance that is presented in our app is always blank. It has no content, no navigation bar (where Done button should be), not subviews, nothing at all.

In the Xcode simulator it will sit in that state forever. However on a device after about a minute the following debug message will appear.

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.}

This bug appears to be specific to one of our projects. I have created a test project and SFSafariViewController works as expected. We are also attempting to load the Google Search landing page, for the purposes of this bug report, in an attempt to eliminate possible resource overload caused by large websites.

Expected Results:
An instance of SFSafariViewController should load the website on presentation.

Actual Results:
A blank, empty white view is displayed.

Comments

Apple Developer Technical Support has replied to me with the following:

"There is a bug in the toolbar class used by the Safari View Controller that causes it to continuously perform layout (essentially in an infinite loop) if it or any of its bar buttons have a background image applied via the appearance proxy. I noticed your code customizes the background image of UIBarButtonItem's appearance in (..). If you remove the following line of code, the issue disappears:

[redacted]

As a workaround, you'll either need to remove the above line of code or restrict the appearance customization to instances where the UIBarButtonItem is contained within your own view controller's (you may need to subclass UINavigationController so that you can target your subclass with [UIBarButtonItem appearanceWhenContainedIn:])."

By calvin.cestari at Dec. 14, 2015, 10:34 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!