<!--
{
  "availability" : [
    "iOS: 4.2.0 - 9.0.0",
    "iPadOS: 4.2.0 - 9.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplicationDelegate/application(_:open:sourceApplication:annotation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIApplicationDelegate(im)application:openURL:sourceApplication:annotation:"
  },
  "title" : "application(_:open:sourceApplication:annotation:)"
}
-->

# application(_:open:sourceApplication:annotation:)

Asks the delegate to open a resource identified by a URL.

```
optional func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool
```

## Parameters

`application`

Your singleton app object.

`url`

The URL resource to open. This resource can be a network resource or a file. For information about the Apple-registered URL schemes, see [Apple URL Scheme Reference](https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899).

`sourceApplication`

The bundle ID of the app that is requesting your app to open the URL (`url`).

`annotation`

A [Property list](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html#//apple_ref/doc/uid/TP40008195-CH44) supplied by the source app to communicate information to the receiving app.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the delegate successfully handled the request or <doc://com.apple.documentation/documentation/Swift/false> if the attempt to open the URL resource failed.

## Discussion

Your implementation of this method should open the specified URL and update its user interface accordingly. If your app had to be launched to open the URL, the app calls the [`application(_:willFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:willFinishLaunchingWithOptions:)) and [`application(_:didFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFinishLaunchingWithOptions:)) methods first, followed by this method. The return values of those methods can be used to prevent this method from being called. (If the app is already running, only this method is called.)

If the URL refers to a file that was opened through a document interaction controller, the `annotation` parameter may contain additional data that the source app wanted to send along with the URL. The format of this data is defined by the app that sent it but the data must consist of objects that can be put into a property list.

Files sent to your app through AirDrop or a document interaction controller are placed in the `Documents/Inbox` directory of your app’s home directory. Your app has permission to read and delete files in this directory but does not have permission to write to them. If you want to modify a file, you must move it to a different directory first. In addition, files in that directory are usually encrypted using data protection. If the file is protected and the user locks the device before this method is called, you will be unable to read the file’s contents immediately. In that case, you should save the URL and try to open the file later rather than return <doc://com.apple.documentation/documentation/Swift/false> from this method. Use the [`isProtectedDataAvailable`](/documentation/UIKit/UIApplication/isProtectedDataAvailable) property of the app object to determine if data protection is currently enabled.

There is no matching notification for this method.

## See Also

[`-  application:didFinishLaunchingWithOptions:`](/documentation/UIKit/UIApplicationDelegate/application(_:didFinishLaunchingWithOptions:))

Tells the delegate that the launch process is almost done and the app is almost ready to run.

[`-  openURL:`](/documentation/UIKit/UIApplication/openURL(_:))

Attempts to open the resource at the specified URL.



---

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)