mirror of https://github.com/SnapKit/SnapKit
Update for Swift 2.3
This commit is contained in:
parent
6ca3393fa6
commit
37dd5e9310
|
@ -454,24 +454,30 @@
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
537DCE911C35CC8800B5B899 = {
|
537DCE911C35CC8800B5B899 = {
|
||||||
CreatedOnToolsVersion = 7.2;
|
CreatedOnToolsVersion = 7.2;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
537DCEAE1C35D90A00B5B899 = {
|
537DCEAE1C35D90A00B5B899 = {
|
||||||
CreatedOnToolsVersion = 7.2;
|
CreatedOnToolsVersion = 7.2;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
56A0DC081C859E30005973AB = {
|
56A0DC081C859E30005973AB = {
|
||||||
CreatedOnToolsVersion = 7.2.1;
|
CreatedOnToolsVersion = 7.2.1;
|
||||||
};
|
};
|
||||||
EEBCC9D719CC627D0083B827 = {
|
EEBCC9D719CC627D0083B827 = {
|
||||||
CreatedOnToolsVersion = 6.0;
|
CreatedOnToolsVersion = 6.0;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
EEBCC9E119CC627D0083B827 = {
|
EEBCC9E119CC627D0083B827 = {
|
||||||
CreatedOnToolsVersion = 6.0;
|
CreatedOnToolsVersion = 6.0;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
EECDB3791AC0C9D4006BBC11 = {
|
EECDB3791AC0C9D4006BBC11 = {
|
||||||
CreatedOnToolsVersion = 6.2;
|
CreatedOnToolsVersion = 6.2;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
EECDB3831AC0C9D4006BBC11 = {
|
EECDB3831AC0C9D4006BBC11 = {
|
||||||
CreatedOnToolsVersion = 6.2;
|
CreatedOnToolsVersion = 6.2;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -690,6 +696,7 @@
|
||||||
PRODUCT_NAME = SnapKit;
|
PRODUCT_NAME = SnapKit;
|
||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
TARGETED_DEVICE_FAMILY = 3;
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
@ -716,6 +723,7 @@
|
||||||
PRODUCT_NAME = SnapKit;
|
PRODUCT_NAME = SnapKit;
|
||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
TARGETED_DEVICE_FAMILY = 3;
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
@ -733,6 +741,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.1;
|
TVOS_DEPLOYMENT_TARGET = 9.1;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
|
@ -748,6 +757,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.1;
|
TVOS_DEPLOYMENT_TARGET = 9.1;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
@ -882,6 +892,7 @@
|
||||||
PRODUCT_NAME = SnapKit;
|
PRODUCT_NAME = SnapKit;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
@ -903,6 +914,7 @@
|
||||||
PRODUCT_NAME = SnapKit;
|
PRODUCT_NAME = SnapKit;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
@ -916,6 +928,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -927,6 +940,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -954,6 +968,7 @@
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SUPPORTED_PLATFORMS = macosx;
|
SUPPORTED_PLATFORMS = macosx;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
@ -980,6 +995,7 @@
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SUPPORTED_PLATFORMS = macosx;
|
SUPPORTED_PLATFORMS = macosx;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
@ -996,6 +1012,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -1012,6 +1029,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
|
SWIFT_VERSION = 2.3;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -417,7 +417,7 @@ private extension NSLayoutAttribute {
|
||||||
#if os(iOS) || os(tvOS)
|
#if os(iOS) || os(tvOS)
|
||||||
switch self {
|
switch self {
|
||||||
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return point.x
|
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return point.x
|
||||||
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .Baseline, .FirstBaseline: return point.y
|
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .LastBaseline, .FirstBaseline: return point.y
|
||||||
case .Right, .RightMargin: return point.x
|
case .Right, .RightMargin: return point.x
|
||||||
case .Bottom, .BottomMargin: return point.y
|
case .Bottom, .BottomMargin: return point.y
|
||||||
case .Leading, .LeadingMargin: return point.x
|
case .Leading, .LeadingMargin: return point.x
|
||||||
|
@ -427,7 +427,7 @@ private extension NSLayoutAttribute {
|
||||||
#else
|
#else
|
||||||
switch self {
|
switch self {
|
||||||
case .Left, .CenterX: return point.x
|
case .Left, .CenterX: return point.x
|
||||||
case .Top, .CenterY, .Baseline: return point.y
|
case .Top, .CenterY, .LastBaseline: return point.y
|
||||||
case .Right: return point.x
|
case .Right: return point.x
|
||||||
case .Bottom: return point.y
|
case .Bottom: return point.y
|
||||||
case .Leading: return point.x
|
case .Leading: return point.x
|
||||||
|
@ -442,7 +442,7 @@ private extension NSLayoutAttribute {
|
||||||
#if os(iOS) || os(tvOS)
|
#if os(iOS) || os(tvOS)
|
||||||
switch self {
|
switch self {
|
||||||
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return insets.left
|
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return insets.left
|
||||||
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .Baseline, .FirstBaseline: return insets.top
|
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .LastBaseline, .FirstBaseline: return insets.top
|
||||||
case .Right, .RightMargin: return insets.right
|
case .Right, .RightMargin: return insets.right
|
||||||
case .Bottom, .BottomMargin: return insets.bottom
|
case .Bottom, .BottomMargin: return insets.bottom
|
||||||
case .Leading, .LeadingMargin: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
case .Leading, .LeadingMargin: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
||||||
|
@ -454,7 +454,7 @@ private extension NSLayoutAttribute {
|
||||||
#else
|
#else
|
||||||
switch self {
|
switch self {
|
||||||
case .Left, .CenterX: return insets.left
|
case .Left, .CenterX: return insets.left
|
||||||
case .Top, .CenterY, .Baseline: return insets.top
|
case .Top, .CenterY, .LastBaseline: return insets.top
|
||||||
case .Right: return insets.right
|
case .Right: return insets.right
|
||||||
case .Bottom: return insets.bottom
|
case .Bottom: return insets.bottom
|
||||||
case .Leading: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
case .Leading: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
||||||
|
|
|
@ -130,7 +130,11 @@ internal struct ConstraintAttributes: OptionSetType, BooleanType {
|
||||||
attrs.append(.CenterY)
|
attrs.append(.CenterY)
|
||||||
}
|
}
|
||||||
if (self.contains(ConstraintAttributes.Baseline)) {
|
if (self.contains(ConstraintAttributes.Baseline)) {
|
||||||
|
#if swift(>=2.3)
|
||||||
|
attrs.append(.LastBaseline)
|
||||||
|
#else
|
||||||
attrs.append(.Baseline)
|
attrs.append(.Baseline)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(iOS) || os(tvOS)
|
#if os(iOS) || os(tvOS)
|
||||||
|
|
|
@ -62,7 +62,10 @@ public extension LayoutConstraint {
|
||||||
|
|
||||||
description += descriptionForObject(self)
|
description += descriptionForObject(self)
|
||||||
|
|
||||||
description += " \(descriptionForObject(self.firstItem))"
|
if let firstItem: AnyObject = self.firstItem {
|
||||||
|
description += " \(descriptionForObject(firstItem))"
|
||||||
|
}
|
||||||
|
|
||||||
if self.firstAttribute != .NotAnAttribute {
|
if self.firstAttribute != .NotAnAttribute {
|
||||||
description += ".\(self.firstAttribute.snp_description)"
|
description += ".\(self.firstAttribute.snp_description)"
|
||||||
}
|
}
|
||||||
|
@ -162,7 +165,7 @@ private extension NSLayoutAttribute {
|
||||||
case .Height: return "height"
|
case .Height: return "height"
|
||||||
case .CenterX: return "centerX"
|
case .CenterX: return "centerX"
|
||||||
case .CenterY: return "centerY"
|
case .CenterY: return "centerY"
|
||||||
case .Baseline: return "baseline"
|
case .LastBaseline: return "baseline"
|
||||||
case .FirstBaseline: return "firstBaseline"
|
case .FirstBaseline: return "firstBaseline"
|
||||||
case .TopMargin: return "topMargin"
|
case .TopMargin: return "topMargin"
|
||||||
case .LeftMargin: return "leftMargin"
|
case .LeftMargin: return "leftMargin"
|
||||||
|
@ -186,7 +189,7 @@ private extension NSLayoutAttribute {
|
||||||
case .Height: return "height"
|
case .Height: return "height"
|
||||||
case .CenterX: return "centerX"
|
case .CenterX: return "centerX"
|
||||||
case .CenterY: return "centerY"
|
case .CenterY: return "centerY"
|
||||||
case .Baseline: return "baseline"
|
case .LastBaseline: return "baseline"
|
||||||
default: return "default"
|
default: return "default"
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue