Is it possible customize SFSafariViewController like edit "Share" button?

4.8k Views Asked by At

Is it possible customize SFSafariViewController like: - change "Share" button - or add new button on same toolbar where "Share" and "Compass" buttons are SFSafariViewController

Any help will be appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

No. However, you can change some specific configuration of that controller. Namely:

  • through SFSafariViewControllerConfiguration, you have barCollapsingEnabled and entersReaderIfAvailable.
  • Data for activityItemsForURL and excludedActivityTypesForURL.
  • preferredBarTintColor and dismissButtonStyle, etc...

Apple says:

Important

In accordance with App Store Review Guidelines, this view controller must be used to visibly present information to users; the controller may not be hidden or obscured by other views or layers. Additionally, an app may not use SFSafariViewController to track users without their knowledge and consent.

Lastly, indeed, you may use WKWebView instead for further customisation of your screen.

If your app lets users view websites from anywhere on the Internet, use the SFSafariViewController class. If your app customizes, interacts with, or controls the display of web content, use the WKWebView class.

Read doc: https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller