<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SafariServices",
  "identifier" : "/documentation/SafariServices/SFSafariViewControllerDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Safari Services"
    ],
    "preciseIdentifier" : "c:objc(pl)SFSafariViewControllerDelegate"
  },
  "title" : "SFSafariViewControllerDelegate"
}
-->

# SFSafariViewControllerDelegate

A protocol used to implement custom event handling for a Safari view controller.

```
protocol SFSafariViewControllerDelegate : NSObjectProtocol
```

## Overview

For more information about the `SFSafariViewController` class, see [`SFSafariViewController`](/documentation/SafariServices/SFSafariViewController).

## Topics

### Working with the View Controller

[`-  safariViewController:didCompleteInitialLoad:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewController(_:didCompleteInitialLoad:))

Tells the delegate that the initial URL load completed.

[`-  safariViewController:activityItemsForURL:title:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewController(_:activityItemsFor:title:))

Tells the delegate that the user tapped an Action button.

[`-  safariViewControllerDidFinish:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewControllerDidFinish(_:))

Tells the delegate that the user dismissed the view.

[`-  safariViewController:excludedActivityTypesForURL:title:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewController(_:excludedActivityTypesFor:title:))

### Instance Methods

[`-  safariViewController:initialLoadDidRedirectToURL:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewController(_:initialLoadDidRedirectTo:))

[`-  safariViewControllerWillOpenInBrowser:`](/documentation/SafariServices/SFSafariViewControllerDelegate/safariViewControllerWillOpenInBrowser(_:))

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)