<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SafariServices",
  "identifier" : "/documentation/SafariServices/SFSafariViewController/init(url:configuration:)-305vl",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Safari Services"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSafariViewController(im)initWithURL:configuration:"
  },
  "title" : "init(url:configuration:)"
}
-->

# init(url:configuration:)

Initializes and configures a Safari view controller that loads the specified URL.

```
init(url URL: URL, configuration: SFSafariViewController.Configuration)
```

## Parameters

`URL`

The URL to navigate to. The URL must use the `http` or `https` scheme.

`configuration`

The configuration for the new view controller.

## Return Value

A newly created Safari view controller.

## Discussion

Use [`init(url:)`](/documentation/SafariServices/SFSafariViewController/init(url:)-5kpkn) to initialize an instance with the default configuration. The initializer copies the specified [`SFSafariViewController.Configuration`](/documentation/SafariServices/SFSafariViewController/Configuration-swift.class) object, so mutating the configuration after invoking the initializer has no effect on the view controller.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)