Skip to content

Commit be3c94d

Browse files
Merge swift3.2 into master
2 parents be3d525 + 9a89411 commit be3c94d

File tree

11 files changed

+83
-18
lines changed

11 files changed

+83
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: objective-c
2-
osx_image: xcode8.3
2+
osx_image: xcode9
33
script:
44
- ./script/cibuild

LayoutExpressions.xcodeproj/project.pbxproj

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
AA6E637F1EF2DCC0000669CD /* DimensionExpressionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1BCE031BE6807E00AB6D1C /* DimensionExpressionTests.swift */; };
7171
AA6E63801EF2DCC0000669CD /* SizeExpressionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA84B8D71943948800827E89 /* SizeExpressionTests.swift */; };
7272
AA6E63821EF2DCC0000669CD /* LayoutExpressions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACF91B9194008D300748874 /* LayoutExpressions.framework */; };
73+
AA5A6FEC1EEA2D8800B6BB72 /* AVPlayerViewController+Anchors.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A6FEB1EEA2D8800B6BB72 /* AVPlayerViewController+Anchors.swift */; };
74+
AA5A6FF01EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A6FEF1EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift */; };
7375
AAC2137F1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC2137E1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift */; };
7476
AAC213801EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC2137E1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift */; };
7577
AAC213821EE9025B00999C65 /* UIViewController+Anchors.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC213811EE9025B00999C65 /* UIViewController+Anchors.swift */; };
@@ -126,6 +128,8 @@
126128
AA4E17731947D15B00E91E41 /* UIViewControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewControllerTests.swift; sourceTree = "<group>"; };
127129
AA6E63871EF2DCC0000669CD /* LayoutExpressionsTests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LayoutExpressionsTests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
128130
AA6E63881EF2DCC0000669CD /* LayoutExpressionsTests copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "LayoutExpressionsTests copy-Info.plist"; path = "/Users/steve/git/LayoutExpressions/LayoutExpressionsTests copy-Info.plist"; sourceTree = "<absolute>"; };
131+
AA5A6FEB1EEA2D8800B6BB72 /* AVPlayerViewController+Anchors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVPlayerViewController+Anchors.swift"; sourceTree = "<group>"; };
132+
AA5A6FEF1EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Anchors.swift"; sourceTree = "<group>"; };
129133
AA84B8D51943868800827E89 /* CenterExpressionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CenterExpressionsTests.swift; sourceTree = "<group>"; };
130134
AA84B8D71943948800827E89 /* SizeExpressionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SizeExpressionTests.swift; sourceTree = "<group>"; };
131135
AAC2137E1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnchorsExtensionsProvider.swift; sourceTree = "<group>"; };
@@ -185,11 +189,10 @@
185189
AA1BCDB71BDC8E7A00AB6D1C /* Extensions */ = {
186190
isa = PBXGroup;
187191
children = (
192+
AA5A6FEE1EEA2D9B00B6BB72 /* Common */,
193+
AA5A6FED1EEA2D8D00B6BB72 /* tvOS */,
188194
AAC2137E1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift */,
189195
AA0D4DF41EE90FDE00A97F6E /* LayoutAreaAnchors.swift */,
190-
AA2D55A519451F0800F41FCC /* UIView+Anchors.swift */,
191-
AAC213811EE9025B00999C65 /* UIViewController+Anchors.swift */,
192-
AA1BCE141BE6963000AB6D1C /* UILayoutGuide+Anchors.swift */,
193196
AA1BCE1A1BE6971C00AB6D1C /* UIView+Expressions.swift */,
194197
AA13D8C81BF4F35F00174DDF /* NSLayoutConstraint+Activation.swift */,
195198
);
@@ -242,6 +245,25 @@
242245
name = Functions;
243246
sourceTree = "<group>";
244247
};
248+
AA5A6FED1EEA2D8D00B6BB72 /* tvOS */ = {
249+
isa = PBXGroup;
250+
children = (
251+
AA5A6FEB1EEA2D8800B6BB72 /* AVPlayerViewController+Anchors.swift */,
252+
);
253+
name = tvOS;
254+
sourceTree = "<group>";
255+
};
256+
AA5A6FEE1EEA2D9B00B6BB72 /* Common */ = {
257+
isa = PBXGroup;
258+
children = (
259+
AA2D55A519451F0800F41FCC /* UIView+Anchors.swift */,
260+
AA5A6FEF1EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift */,
261+
AAC213811EE9025B00999C65 /* UIViewController+Anchors.swift */,
262+
AA1BCE141BE6963000AB6D1C /* UILayoutGuide+Anchors.swift */,
263+
);
264+
name = Common;
265+
sourceTree = "<group>";
266+
};
245267
AACF91AF194008D300748874 = {
246268
isa = PBXGroup;
247269
children = (
@@ -494,7 +516,9 @@
494516
AA0D4DF61EE90FDE00A97F6E /* LayoutAreaAnchors.swift in Sources */,
495517
AA1BCE0C1BE6885100AB6D1C /* EdgesExpression.swift in Sources */,
496518
AA1BCE231BE6D75300AB6D1C /* Offset.swift in Sources */,
519+
AA5A6FEC1EEA2D8800B6BB72 /* AVPlayerViewController+Anchors.swift in Sources */,
497520
AAC213801EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift in Sources */,
521+
AA5A6FF11EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift in Sources */,
498522
AA1BCE1F1BE6A13000AB6D1C /* CenterExpression.swift in Sources */,
499523
AA1BCE1C1BE6971C00AB6D1C /* UIView+Expressions.swift in Sources */,
500524
AA1BCDFD1BE6787D00AB6D1C /* DimensionExpression.swift in Sources */,
@@ -540,6 +564,7 @@
540564
AA00F7BC1940ABE000F92B8B /* Expression.swift in Sources */,
541565
AA0D4DF51EE90FDE00A97F6E /* LayoutAreaAnchors.swift in Sources */,
542566
AA1BCE0B1BE6885100AB6D1C /* EdgesExpression.swift in Sources */,
567+
AA5A6FF01EEA2E1E00B6BB72 /* UIScrollView+Anchors.swift in Sources */,
543568
AA1BCE221BE6D75300AB6D1C /* Offset.swift in Sources */,
544569
AAC2137F1EE8E2AC00999C65 /* AnchorsExtensionsProvider.swift in Sources */,
545570
AA1BCE1E1BE6A13000AB6D1C /* CenterExpression.swift in Sources */,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright © 2017 Steve Brambilla. All rights reserved.
2+
3+
import AVKit
4+
5+
extension Anchors where Base: AVPlayerViewController {
6+
/// A layout area representing the view's `unobscuredContentGuide`.
7+
@available(tvOS 11.0, *)
8+
public var unobstructed: LayoutAreaAnchors {
9+
return LayoutAreaAnchors(guide: base.unobscuredContentGuide)
10+
}
11+
}

LayoutExpressions/AxisExpression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public struct AxisAnchor<Axis: AxisProtocol, Constant: ConstantProtocol> {
8080
return axis.anchor
8181
}
8282

83-
fileprivate func update<NextConstant: ConstantProtocol>(constant: NextConstant) -> AxisAnchor<Axis, NextConstant> {
83+
fileprivate func update<NextConstant>(constant: NextConstant) -> AxisAnchor<Axis, NextConstant> {
8484
return AxisAnchor<Axis, NextConstant>(axis: axis, constant: constant)
8585
}
8686

LayoutExpressions/CenterExpression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct CenterAnchor<Offset: OffsetProtocol> {
5858
self.offset = offset
5959
}
6060

61-
fileprivate func updateOffset<NextOffset: OffsetProtocol>(_ offset: NextOffset) -> CenterAnchor<NextOffset> {
61+
fileprivate func updateOffset<NextOffset>(_ offset: NextOffset) -> CenterAnchor<NextOffset> {
6262
return CenterAnchor<NextOffset>(centerXAnchor: centerXAnchor, centerYAnchor: centerYAnchor, offset: offset)
6363
}
6464

LayoutExpressions/Constraints.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import UIKit
66
// MARK: - Layout Anchors
77

88
internal struct AnchorConstraints {
9-
internal static func constraintForRelation<AnchorType: AnyObject>(relation: Relation, leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
9+
internal static func constraintForRelation<AnchorType>(relation: Relation, leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
1010
switch relation {
1111
case .lessThanOrEqual:
1212
return lessThanOrEqualConstraintForLeftAnchor(leftAnchor: leftAnchor, rightAnchor: rightAnchor, constant: constant)
@@ -17,15 +17,15 @@ internal struct AnchorConstraints {
1717
}
1818
}
1919

20-
fileprivate static func lessThanOrEqualConstraintForLeftAnchor<AnchorType: AnyObject>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
20+
fileprivate static func lessThanOrEqualConstraintForLeftAnchor<AnchorType>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
2121
return leftAnchor.constraint(lessThanOrEqualTo: rightAnchor, constant: constant)
2222
}
2323

24-
fileprivate static func equalConstraintForLeftAnchor<AnchorType: AnyObject>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
24+
fileprivate static func equalConstraintForLeftAnchor<AnchorType>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
2525
return leftAnchor.constraint(equalTo: rightAnchor, constant: constant)
2626
}
2727

28-
fileprivate static func greaterThanOrEqualConstraintForLeftAnchor<AnchorType: AnyObject>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
28+
fileprivate static func greaterThanOrEqualConstraintForLeftAnchor<AnchorType>(leftAnchor: NSLayoutAnchor<AnchorType>, rightAnchor: NSLayoutAnchor<AnchorType>, constant: CGFloat) -> NSLayoutConstraint {
2929
return leftAnchor.constraint(greaterThanOrEqualTo: rightAnchor, constant: constant)
3030
}
3131
}

LayoutExpressions/DimensionExpression.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ public struct DimensionAnchor<Multiplier: MultiplierProtocol, Constant: Constant
9696
self.constant = constant
9797
}
9898

99-
fileprivate func update<NextMultiplier: MultiplierProtocol>(multiplier: NextMultiplier) -> DimensionAnchor<NextMultiplier, Constant> {
99+
fileprivate func update<NextMultiplier>(multiplier: NextMultiplier) -> DimensionAnchor<NextMultiplier, Constant> {
100100
return DimensionAnchor<NextMultiplier, Constant>(dimension: dimension, multiplier: multiplier, constant: constant)
101101
}
102102

103-
fileprivate func update<NextConstant: ConstantProtocol>(constant: NextConstant) -> DimensionAnchor<Multiplier, NextConstant> {
103+
fileprivate func update<NextConstant>(constant: NextConstant) -> DimensionAnchor<Multiplier, NextConstant> {
104104
return DimensionAnchor<Multiplier, NextConstant>(dimension: dimension, multiplier: multiplier, constant: constant)
105105
}
106106

LayoutExpressions/EdgesExpression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public struct EdgesAnchor<Insets: InsetsProtocol> {
7272
self.insets = insets
7373
}
7474

75-
fileprivate func update<NextInsets: InsetsProtocol>(insets: NextInsets) -> EdgesAnchor<NextInsets> {
75+
fileprivate func update<NextInsets>(insets: NextInsets) -> EdgesAnchor<NextInsets> {
7676
return EdgesAnchor<NextInsets>(topAnchor: topAnchor, leftAnchor: leftAnchor, bottomAnchor: bottomAnchor, rightAnchor: rightAnchor, insets: insets)
7777
}
7878

LayoutExpressions/SizeExpression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public struct SizeAnchor<Size: SizeProtocol> {
9797
self.size = size
9898
}
9999

100-
fileprivate func update<NextSize: SizeProtocol>(size: NextSize) -> SizeAnchor<NextSize> {
100+
fileprivate func update<NextSize>(size: NextSize) -> SizeAnchor<NextSize> {
101101
return SizeAnchor<NextSize>(widthAnchor: widthAnchor, heightAnchor: heightAnchor, size: size)
102102
}
103103

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright © 2017 Steve Brambilla. All rights reserved.
2+
3+
import UIKit
4+
5+
extension Anchors where Base: UIScrollView {
6+
/// A layout area representing the view's `contentLayoutGuide`.
7+
@available(iOS 11.0, tvOS 11.0, *)
8+
public var content: LayoutAreaAnchors {
9+
return LayoutAreaAnchors(guide: base.contentLayoutGuide)
10+
}
11+
12+
/// A layout area representing the view's `frameLayoutGuide`.
13+
@available(iOS 11.0, tvOS 11.0, *)
14+
public var frame: LayoutAreaAnchors {
15+
return LayoutAreaAnchors(guide: base.frameLayoutGuide)
16+
}
17+
}

0 commit comments

Comments
 (0)