# Set APPLICATION\_EXTENSION\_API\_ONLY on a SPM package

**URL:** <https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333>\
**Category:** Using Swift\
**Tags:** packagemanager\
**Created:** [August 12, 2020, 5:58pm UTC](https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333 "2020-08-12T17:58:36Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jakepetroules](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jakepetroules/32/5229_2.png) [@jakepetroules](https://forums.swift.org/u/jakepetroules)\
**Post date:** [July 15, 2021, 4:20pm UTC](https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333/11 "2021-07-15T16:20:14Z")

</div>

As stated in the Xcode 13 beta 3 release notes:

> - 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)

You can add the:

```
@available(iOSApplicationExtension, unavailable)

```

attribute to declarations using app extension unavailable APIs in order to get them to compile in a way that works for both apps and app extensions.

---

_[View the full topic](https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333)._
