Search code examples
iosswiftios9

Change tintcolor of SFSafariViewController?


As the title says; how does one change the overall tint color of the new, in iOS 9, SFSafariViewController?


Solution

  • Some news from iOS 10: now we have two properties to control the overall looks of the SFSafariViewController

    doc

    source: link

    The only downside is, of course, it's not available for older versions.

    if #available(iOS 10.0, *) {
        safariVC.preferredBarTintColor = .black
        safariVC.preferredControlTintColor = .white
    } else {
        safariVC.view.tintColor = .someColor
    }