Deprecate API by version of my package

I want to use the available attributes in my package to specify when some API becomes available, or for when some API becomes deprecated.

https://docs.swift.org/swift-book/ReferenceManual/Attributes.html

At the moment, it seems I can only specify the release of the operating system (not the release of my package). Is this correct?

So for instance I have a package named JellyBeans and the following suggests that the API was deprecated in the release of iOS 2.0.1, (as opposed to the release of JellyBeans 2.0.1).

@available(iOS, deprecated: 2.0.1)
1 Like

Correct, though you can specify any release

@available(*, deprecated, message: "This API was deprecated in 2.0.1")

So it shows up in clients

1 Like

Seems worthy of a Pitch to extend @available to specify @available(PackageName, …) (at least to hear from experts in the discussion if there’s some technological barriers to this approach).

2 Likes

@toph42 has this been proposed?

Might point out: