Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Compiler error 'shared' is unavailable in application extensions for iOS with SPM and Xcode 13 beta 3 #331

@martinknabbe

Description

@martinknabbe

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 33

This error appears due to the changes in the linker mentioned in the Xcode release notes

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)

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 and NS_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions