- update
This commit is contained in:
1 parent
1bf4b9ef1d
commit
4e66c377fd
664 files changed
+14818
-10172
No files matched your search
+19
-19
@@ -31,35 +31,35 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// Define some preprocessor macros to check for a minimum Base SDK. These are used to prevent compile-time errors in older versions of Xcode.
|
||||
#define __PureLayout_MinBaseSDK_iOS_8_0 (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1)
|
||||
#define __PureLayout_MinBaseSDK_OSX_10_10 (!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9)
|
||||
#define PL__PureLayout_MinBaseSDK_iOS_8_0 (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1)
|
||||
#define PL__PureLayout_MinBaseSDK_OSX_10_10 (!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9)
|
||||
|
||||
// Define some preprocessor macros to check for a minimum System Version. These are used to prevent runtime crashes on older versions of iOS/OS X.
|
||||
#define __PureLayout_MinSysVer_iOS_7_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
|
||||
#define __PureLayout_MinSysVer_iOS_8_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1)
|
||||
#define __PureLayout_MinSysVer_OSX_10_9 (!TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_8_4)
|
||||
#define PL__PureLayout_MinSysVer_iOS_7_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
|
||||
#define PL__PureLayout_MinSysVer_iOS_8_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1)
|
||||
#define PL__PureLayout_MinSysVer_OSX_10_9 (!TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_8_4)
|
||||
|
||||
// Define some preprocessor macros that allow nullability annotations to be adopted in a backwards-compatible manner.
|
||||
#if __has_feature(nullability)
|
||||
# define __PL_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
|
||||
# define __PL_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
|
||||
# define PL__ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
|
||||
# define PL__ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
|
||||
#else
|
||||
# define __PL_ASSUME_NONNULL_BEGIN
|
||||
# define __PL_ASSUME_NONNULL_END
|
||||
# define PL__ASSUME_NONNULL_BEGIN
|
||||
# define PL__ASSUME_NONNULL_END
|
||||
#endif
|
||||
|
||||
// Define some preprocessor macros that allow generics to be adopted in a backwards-compatible manner.
|
||||
#if __has_feature(objc_generics)
|
||||
# define __PL_GENERICS(class, ...) class<__VA_ARGS__>
|
||||
# define PL__GENERICS(class, ...) class<__VA_ARGS__>
|
||||
#else
|
||||
# define __PL_GENERICS(class, ...) class
|
||||
# define PL__GENERICS(class, ...) class
|
||||
#endif
|
||||
|
||||
// Using generics with NSArray is so common in PureLayout that it gets a dedicated preprocessor macro for better readability.
|
||||
#define __NSArray_of(type) __PL_GENERICS(NSArray, type)
|
||||
#define PL__NSArray_of(type) PL__GENERICS(NSArray, type)
|
||||
|
||||
// Define generic AL-prefixed macros for the types/constants/etc that have slight naming variations across iOS and OS X, which allows the same code to be platform-independent.
|
||||
#if TARGET_OS_IPHONE
|
||||
#if TARGET_OS_IPHONE || TARGET_OS_TV
|
||||
# import <UIKit/UIKit.h>
|
||||
# define ALView UIView
|
||||
# define ALEdgeInsets UIEdgeInsets
|
||||
@@ -135,13 +135,13 @@ typedef NS_ENUM(NSInteger, ALAxis) {
|
||||
ALAxisBaseline = NSLayoutAttributeBaseline,
|
||||
/** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) */
|
||||
ALAxisLastBaseline = ALAxisBaseline,
|
||||
#if __PureLayout_MinBaseSDK_iOS_8_0
|
||||
#if PL__PureLayout_MinBaseSDK_iOS_8_0
|
||||
/** A horizontal line at the baseline of the first line of text in a view. (For views that do not draw text, will be equivalent to ALEdgeTop.) Available in iOS 8.0 and later. */
|
||||
ALAxisFirstBaseline = NSLayoutAttributeFirstBaseline
|
||||
#endif /* __PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
#endif /* PL__PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
};
|
||||
|
||||
#if __PureLayout_MinBaseSDK_iOS_8_0
|
||||
#if PL__PureLayout_MinBaseSDK_iOS_8_0
|
||||
|
||||
/** Constants that represent layout margins of a view. Available in iOS 8.0 and later. */
|
||||
typedef NS_ENUM(NSInteger, ALMargin) {
|
||||
@@ -167,7 +167,7 @@ typedef NS_ENUM(NSInteger, ALMarginAxis) {
|
||||
ALMarginAxisHorizontal = NSLayoutAttributeCenterYWithinMargins
|
||||
};
|
||||
|
||||
#endif /* __PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
#endif /* PL__PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
|
||||
/** An attribute of a view that can be used in auto layout constraints. These constants are identical to the more specific enum types:
|
||||
ALEdge, ALAxis, ALDimension, ALMargin, ALMarginAxis. It is safe to cast a more specific enum type to the ALAttribute type. */
|
||||
@@ -196,7 +196,7 @@ typedef NS_ENUM(NSInteger, ALAttribute) {
|
||||
ALAttributeBaseline = ALAxisBaseline,
|
||||
/** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) */
|
||||
ALAttributeLastBaseline = ALAxisLastBaseline,
|
||||
#if __PureLayout_MinBaseSDK_iOS_8_0
|
||||
#if PL__PureLayout_MinBaseSDK_iOS_8_0
|
||||
/** A horizontal line at the baseline of the first line of text in a view. (For views that do not draw text, will be equivalent to ALEdgeTop.) Available in iOS 8.0 and later. */
|
||||
ALAttributeFirstBaseline = ALAxisFirstBaseline,
|
||||
/** The left margin of the view, based on the view's layoutMargins left inset. */
|
||||
@@ -215,7 +215,7 @@ typedef NS_ENUM(NSInteger, ALAttribute) {
|
||||
ALAttributeMarginAxisVertical = ALMarginAxisVertical,
|
||||
/** A horizontal line equidistant from the view's top and bottom margins. */
|
||||
ALAttributeMarginAxisHorizontal = ALMarginAxisHorizontal
|
||||
#endif /* __PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
#endif /* PL__PureLayout_MinBaseSDK_iOS_8_0 */
|
||||
};
|
||||
|
||||
/** A block containing method calls to the PureLayout API. Takes no arguments and has no return value. */
|
||||
|
||||
Reference in new issue
Block a user