Skip to content

Commit

Permalink
Remove unnecessary parens in README.md
Browse files Browse the repository at this point in the history
Swift does not require parens for `if` conditions as opposed to C/C++/JavaScript etc
  • Loading branch information
MaxDesiatov authored Mar 31, 2020
1 parent 4f664cf commit 0523d6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Replace oauth-swift by your application name
- On iOS implement `UIApplicationDelegate` method
```swift
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if (url.host == "oauth-callback") {
if url.host == "oauth-callback" {
OAuthSwift.handle(url: url)
}
return true
Expand All @@ -77,15 +77,15 @@ func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)
guard let url = URLContexts.first?.url else {
return
}
if (url.host == "oauth-callback") {
if url.host == "oauth-callback" {
OAuthSwift.handle(url: url)
}
}
```

:warning: Any other application may try to open a URL with your url scheme. So you can check the source application, for instance for safari controller :
```
if (options[.sourceApplication] as? String == "com.apple.SafariViewService") {
if options[.sourceApplication] as? String == "com.apple.SafariViewService" {
```

- On macOS you must register a handler on `NSAppleEventManager` for event type `kAEGetURL` (see demo code)
Expand Down

0 comments on commit 0523d6a

Please sign in to comment.