返回列表

# 225-What's new in Safari View Controller

# Matching your app's style

var preferredBarTintColor: UIColor?
1

The color to tint the background of the navigation bar and the toolbar.

var preferredControlTintColor: UIColor?
1

The color to tint the the control buttons on the navigation bar and the toolbar.

# iOS 11 improvements

  1. Drag and drop urls to other apps
  2. Status Bar style. UIViewControllerBasedStatusBarAppearnce = YES in Info.plist
  3. Support window.open
  4. Privacy. Safari View Controller 有 separate、persistent data stores,与别的 App 以及 Safari 相互独立
  5. Private Browsing. Safari View Controller 的 private browsing 与 Safari 相互独立

# Tailoring Safari View Controller

# Dismiss Style

var dismissButtonStyle: SFSafariViewController.DismissButtonStyle
enum DismissButtonStyle {
  case done
  case close
  case cancel
}
1
2
3
4
5
6

# Collapse

var configuration: SFSafariViewController.Configuration
var barCollapsingEnabled: Bool
init(url URL: URL, configuration: SFSafariViewController.Configuration)
1
2
3

# Share

Tells the delegate that the user tapped an Action button.
func safariViewController(_ controller: SFSafariViewController, activityItemsFor URL: URL, title: String?) -> [UIActivity]
1
2

# Present

controller.transitioningDelegate = self
提供默认的实现,从而实现从下往上 present
1
2