When building an app with SwiftMessages from Swift Package Manager in Xcode 13 beta 3 that does not use app extensions, compiler errors related to API availability in app extensions are emitted.
Reproduction Steps
Create a new iOS project in Xcode 13 beta 3
Add SwiftMessages on branch work/9.0.4 using Swift Package Manager
Build the app
Result: multiple errors on UIApplication.shared usage:
'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
Other Notes
This appears to be expected behavior in Xcode 13 beta 3 with Swift Package Manager, based on this Apple Developer Forums thread and this Swift forums post. The Apple engineer in the second link recommends dealing with this by marking declarations as unavailable to app extensions when they use APIs that are unavailable to app extensions.
Update: It looks like the Swift team is reconsidering how this behaves. I'll update this issue as we hear more from them.
When building an app with SwiftMessages from Swift Package Manager in Xcode 13 beta 3 that does not use app extensions, compiler errors related to API availability in app extensions are emitted.
Reproduction Steps
work/9.0.4
using Swift Package ManagerResult: multiple errors on
UIApplication.shared
usage:Other Notes
This appears to be expected behavior in Xcode 13 beta 3 with Swift Package Manager, based on this Apple Developer Forums thread and this Swift forums post. The Apple engineer in the second link recommends dealing with this by marking declarations as unavailable to app extensions when they use APIs that are unavailable to app extensions.
Update: It looks like the Swift team is reconsidering how this behaves. I'll update this issue as we hear more from them.