Search code examples
iosxcodetvos

__IOS_UNAVAIBLE makes it __TVOS_UNAVAILABLE too?


Am I going crazy, or is it just me? I've marked different properties, classes and functions as __IOS_UNAVAILABLE. However, when I do this it also makes the property, class or function unavailable on tvOS as well. Is this a bug or something?


Solution

  • You should not be using __IOS_UNAVAILABLE and __TVOS_UNAVAILABLE in your own code. Those are specifically for use by the OS SDKs for annotating what version of the OS introduced certain functionality.

    It is expected that __IOS_UNAVAILABLE will cause it it be unavailable on tvOS and watchOS unless explicitly marked as available on those platforms (as they inherit from iOS).