Skip to content

Commit 004d73a

Browse files
committed
Merge pull request SnapKit#153 from brittonmobile/develop
Added tvOS checks so the iOS paths are used rather than OS X
2 parents 99d503a + 7fc0537 commit 004d73a

13 files changed

+21
-21
lines changed

Source/Constraint.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit
@@ -119,7 +119,7 @@ internal class ConcreteConstraint: Constraint {
119119
self.updatePriority(Float(750.0))
120120
}
121121
internal override func updatePriorityMedium() -> Void {
122-
#if os(iOS)
122+
#if os(iOS) || os(tvOS)
123123
self.updatePriority(Float(500.0))
124124
#else
125125
self.updatePriority(Float(501.0))
@@ -251,7 +251,7 @@ internal class ConcreteConstraint: Constraint {
251251
let layoutConstant: CGFloat = layoutToAttribute.snp_constantForValue(self.constant)
252252

253253
// get layout to
254-
#if os(iOS)
254+
#if os(iOS) || os(tvOS)
255255
var layoutTo: AnyObject? = self.toItem.view ?? self.toItem.layoutSupport
256256
#else
257257
var layoutTo: AnyObject? = self.toItem.view
@@ -397,7 +397,7 @@ private extension NSLayoutAttribute {
397397
}
398398
// CGPoint
399399
else if let point = value as? CGPoint {
400-
#if os(iOS)
400+
#if os(iOS) || os(tvOS)
401401
switch self {
402402
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return point.x
403403
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .Baseline, .FirstBaseline: return point.y
@@ -422,7 +422,7 @@ private extension NSLayoutAttribute {
422422
}
423423
// EdgeInsets
424424
else if let insets = value as? EdgeInsets {
425-
#if os(iOS)
425+
#if os(iOS) || os(tvOS)
426426
switch self {
427427
case .Left, .CenterX, .LeftMargin, .CenterXWithinMargins: return insets.left
428428
case .Top, .CenterY, .TopMargin, .CenterYWithinMargins, .Baseline, .FirstBaseline: return insets.top

Source/ConstraintAttributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit
@@ -133,7 +133,7 @@ internal struct ConstraintAttributes: OptionSetType, BooleanType {
133133
attrs.append(.Baseline)
134134
}
135135

136-
#if os(iOS)
136+
#if os(iOS) || os(tvOS)
137137
#if SNAPKIT_DEPLOYMENT_LEGACY
138138
guard #available(iOS 8.0, *) else {
139139
return attrs

Source/ConstraintDescription.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit
@@ -464,7 +464,7 @@ internal class ConstraintDescription: ConstraintDescriptionExtendable, Constrain
464464
return self.priority(750.0)
465465
}
466466
internal func priorityMedium() -> ConstraintDescriptionFinalizable {
467-
#if os(iOS)
467+
#if os(iOS) || os(tvOS)
468468
return self.priority(500.0)
469469
#else
470470
return self.priority(501.0)

Source/ConstraintItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit

Source/ConstraintMaker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit

Source/ConstraintRelation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit

Source/Debugging.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit
@@ -149,7 +149,7 @@ private extension NSLayoutRelation {
149149
private extension NSLayoutAttribute {
150150

151151
private var snp_description: String {
152-
#if os(iOS)
152+
#if os(iOS) || os(tvOS)
153153
switch self {
154154
case .NotAnAttribute: return "notAnAttribute"
155155
case .Top: return "top"

Source/EdgeInsets.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
public typealias EdgeInsets = UIEdgeInsets
2727
public func EdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> EdgeInsets {

Source/LayoutConstraint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
#else
2727
import AppKit

Source/SnapKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(tvOS)
2525
import UIKit
2626
public typealias InterfaceLayoutDirection = UIUserInterfaceLayoutDirection
2727
public typealias LayoutSupport = UILayoutSupport

0 commit comments

Comments
 (0)