Currently, master cannot be compiled for watchOS because it attempts to deal with an UIApplication memory warning. The memory warning and the class UIApplication are both unavailable on watchOS.
This pull request ensures that a watchOS compilation does not try to compile this existing code.
Notes:
TARGET_OS_IPHONE is defined and true for both iOS and watchOS
TARGET_OS_IOS is a new flag in the iOS 9/watchOS 2 SDKs that is only true for iOS compilation
There is another new flag that is TARGET_OS_WATCH, but it would be odd to conditionally exclude something that is specifically for one platform
This PR could have been simplified by doing #if TARGET_OS_IOS and removing TARGET_OS_IPHONE altogether, but that would cause issues for previous SDKs. This approach works for current, past, and “future” SDK/Xcode versions.
Currently,
master
cannot be compiled for watchOS because it attempts to deal with anUIApplication
memory warning. The memory warning and the classUIApplication
are both unavailable on watchOS.This pull request ensures that a watchOS compilation does not try to compile this existing code.
Notes:
TARGET_OS_IPHONE
is defined and true for both iOS and watchOSTARGET_OS_IOS
is a new flag in the iOS 9/watchOS 2 SDKs that is only true for iOS compilationTARGET_OS_WATCH
, but it would be odd to conditionally exclude something that is specifically for one platformThis PR could have been simplified by doing
#if TARGET_OS_IOS
and removingTARGET_OS_IPHONE
altogether, but that would cause issues for previous SDKs. This approach works for current, past, and “future” SDK/Xcode versions.