In Swift we can write something like this:
@available(iOS, introduced: 14.0, obsoleted: 15.0)
@objc extension Foo {
func foo(_ arg: AnyObject) {}
}
I believe that this means "api will only be available for ios versions 14.0 .. 14.9.9"
In Objective-C I want to write this:
@interface Foo (FooCategory)
- (void) foo:(id)someId API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(ios(15.0));
@end
But this doesn't work coz API_UNAVAILABLE only accepts platform without specific version.
How can I restrict some API to the exact version of a specific platform?
The name of the macro you're looking for is
API_DEPRECATED.Its documentation looks like this: