Rework ASTraitCollection to Fix Warnings and Remove Boilerplate (#1211)

* Clean up trait collection to fix a ton of warnings and remove code

* Support Xcode 9 (iOS 11 SDK)

* Hack harder
This commit is contained in:
Adlai Holler
2018-11-06 08:31:09 -08:00
committed by GitHub
parent 5c9815f46d
commit e392f832f4
6 changed files with 123 additions and 499 deletions

View File

@@ -21,6 +21,18 @@
# define let const __auto_type
#endif
/**
* Hack to support building for iOS with Xcode 9. UIUserInterfaceStyle was previously tvOS-only,
* and it was added to iOS 12. Xcode 9 (iOS 11 SDK) will flat-out refuse to build anything that
* references this enum targeting iOS, even if it's guarded with the right availability macros,
* because it thinks the entire platform isn't compatible with the enum.
*/
#if TARGET_OS_TV || (defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0)
#define AS_BUILD_UIUSERINTERFACESTYLE 1
#else
#define AS_BUILD_UIUSERINTERFACESTYLE 0
#endif
#ifdef __GNUC__
# define ASDISPLAYNODE_GNUC(major, minor) \
(__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))