[GH-ISSUE #669] Swift compiler errors - Xcode 13.0 beta 3 #433

Open
opened 2026-03-03 16:48:40 +03:00 by kerem · 3 comments
Owner

Originally created by @johnnysay on GitHub (Jul 23, 2021).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/669

Description:

While building with Xcode 13.0 beta 3 I got many compiler errors:

  • 'open(_:options:completionHandler:)' is unavailable in application extensions for iOS
  • 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
    These errors occur in code that contains one of those lines:
  • UIApplication.shared.open(url, options: [:], completionHandler: nil)
  • UIApplication.shared.open(url)
    For example in Handoler/OAuthSwiftOpenURLExternally.swift line 28.

OS (Please fill the version) :

  • iOS : 15.0

Installation method:

  • Swift Package Manager

Library version:

  • v2.2.0

Xcode version:

  • 13.0 (Swift 5)
Originally created by @johnnysay on GitHub (Jul 23, 2021). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/669 ### Description: While building with Xcode 13.0 beta 3 I got many compiler errors: - 'open(_:options:completionHandler:)' is unavailable in application extensions for iOS - 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. These errors occur in code that contains one of those lines: - `UIApplication.shared.open(url, options: [:], completionHandler: nil)` - `UIApplication.shared.open(url)` For example in Handoler/OAuthSwiftOpenURLExternally.swift line 28. ### OS (Please fill the version) : - [x] iOS : 15.0 ### Installation method: - [x] Swift Package Manager ### Library version: - [x] v2.2.0 ### Xcode version: - [x] 13.0 (Swift 5)
Author
Owner

@phimage commented on GitHub (Jul 23, 2021):

I have never fixed such things but on one of my other project someone talk me about new annotation @available(iOSApplicationExtension,
https://github.com/phimage/CallbackURLKit/issues/31

<!-- gh-comment-id:885802500 --> @phimage commented on GitHub (Jul 23, 2021): I have never fixed such things but on one of my other project someone talk me about new annotation `@available(iOSApplicationExtension,` https://github.com/phimage/CallbackURLKit/issues/31
Author
Owner

@kkebo commented on GitHub (Jul 28, 2021):

In addition, according to https://developer.apple.com/documentation/xcode-release-notes/xcode-13-beta-release-notes,

Swift Packages

Resolved in Xcode 13 Beta 3

Linking Swift packages from application extension targets or watchOS applications no longer emits unresolvable warnings about linking to libraries not safe for use in application extensions. This means that code referencing APIs annotated as unavailable for use in app extensions must now themselves be annotated as unavailable for use in application extensions, in order to allow that code to be used in both apps and app extensions. (66928265)

@phimage Do you plan to add that annotation?

<!-- gh-comment-id:887949797 --> @kkebo commented on GitHub (Jul 28, 2021): In addition, according to https://developer.apple.com/documentation/xcode-release-notes/xcode-13-beta-release-notes, > Swift Packages > > Resolved in Xcode 13 Beta 3 > > Linking Swift packages from application extension targets or watchOS applications no longer emits unresolvable warnings about linking to libraries not safe for use in application extensions. **This means that code referencing APIs annotated as unavailable for use in app extensions must now themselves be annotated as unavailable for use in application extensions**, in order to allow that code to be used in both apps and app extensions. (66928265) @phimage Do you plan to add that annotation?
Author
Owner

@phimage commented on GitHub (Jul 28, 2021):

PR are welcome

<!-- gh-comment-id:888033325 --> @phimage commented on GitHub (Jul 28, 2021): PR are welcome
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#433
No description provided.