Open martinknabbe opened 3 years ago
Not sure what the future plan is in SwiftPM, but this was reverted for now in Xcode 13 beta 5.
Swift Packages Resolved in Xcode 13 Beta 5
You don’t need to annotate code as unavailable for use in application extensions if it references APIs annotated as unavailable for use in application extensions. This reverts a requirement that Xcode 13 Beta 3 introduced. (80615922) (FB9332020)
Thread with some more details: https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333/27
Report
What did you do?
Integrating SkyFloatingLabelTextField version 4.0.0 with Swift Package Manager and Xcode 13 beta 3 (13A5192i).
What did you expect to happen?
Library compiles without errors.
What happened instead?
Compiler emits error
'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
SkyFloatingLabelTextField.swift line 33This error appears due to the changes in the linker mentioned in the Xcode release notes
All libraries that use API marked as unavailable in iOS app extensions, such as
UIApplication.shared
, have to mark their code themself with@available(iOSApplicationExtension, unavailable)
in Swift andNS_EXTENSION_UNAVAILABLE
in Objective-C.Environment
Xcode Version: 13 beta 3 (13A5192i) SkyFloatingLabelTextField Version: 4.0.0 Deployment Target: iOS 11.4 Base SDK: 15.0 Method of Integration: Swift Package Manager