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

# safariViewControllerDidFinish(_:)

Tells the delegate that the user dismissed the view.

```
optional func safariViewControllerDidFinish(_ controller: SFSafariViewController)
```

## Parameters

`controller`

The view controller.

## Discussion

You can perform any necessary cleanup here. The view controller is dismissed afterwards.

---

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)