---
title: "openURL(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiapplication/openurl(_:)"
---

# openURL(_:)

Attempts to open the resource at the specified URL.

## Declaration

```swift
func openURL(_ url: URL) -> Bool
```

## Parameters

- `url`: A URL (Universal Resource Locator). UIKit supports many common schemes, including the http, https, tel, facetime, and mailto schemes. You can also employ custom URL schemes associated with apps installed on the device.

## Return Value

Return Value true if the resource located by the URL was successfully opened; otherwise false.

## Discussion

Discussion The URL you pass to this method can identify a resource in the app that calls the method, or a resource to be handled by another app. If the resource is to be handled another app, invoking this method might cause the calling app to quit so the other can launch. To check if there is an installed app that can handle a scheme, call the canOpenURL(_:) method before calling this one. Be sure to read the description of that method for an important note about registering the schemes you want to employ.

## See Also

### Related Documentation

- [application(_:handleOpen:)](uikit/uiapplicationdelegate/application(_:handleopen:).md)
- [canOpenURL(_:)](uikit/uiapplication/canopenurl(_:).md)

### Deprecated methods

- [requestSceneSessionActivation(_:userActivity:options:errorHandler:)](uikit/uiapplication/requestscenesessionactivation(_:useractivity:options:errorhandler:).md)
- [beginIgnoringInteractionEvents()](uikit/uiapplication/beginignoringinteractionevents().md)
- [endIgnoringInteractionEvents()](uikit/uiapplication/endignoringinteractionevents().md)
- [setMinimumBackgroundFetchInterval(_:)](uikit/uiapplication/setminimumbackgroundfetchinterval(_:).md)
- [scheduleLocalNotification(_:)](uikit/uiapplication/schedulelocalnotification(_:).md)
- [presentLocalNotificationNow(_:)](uikit/uiapplication/presentlocalnotificationnow(_:).md)
- [cancelLocalNotification(_:)](uikit/uiapplication/cancellocalnotification(_:).md)
- [cancelAllLocalNotifications()](uikit/uiapplication/cancelalllocalnotifications().md)
- [setKeepAliveTimeout(_:handler:)](uikit/uiapplication/setkeepalivetimeout(_:handler:).md)
- [UIMinimumKeepAliveTimeout](uikit/uiminimumkeepalivetimeout.md)
- [clearKeepAliveTimeout()](uikit/uiapplication/clearkeepalivetimeout().md)
- [setStatusBarHidden(_:with:)](uikit/uiapplication/setstatusbarhidden(_:with:).md)
- [setStatusBarStyle(_:animated:)](uikit/uiapplication/setstatusbarstyle(_:animated:).md)
- [setStatusBarOrientation(_:animated:)](uikit/uiapplication/setstatusbarorientation(_:animated:).md)
- [registerUserNotificationSettings(_:)](uikit/uiapplication/registerusernotificationsettings(_:).md)
