Skip to content

Commit e3290a8

Browse files
author
Luc Dion
committed
Update
1 parent 81c7216 commit e3290a8

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

PinLayout.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
DF28022520C2B13900A1833B /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFF222CC20B999BD00AC2A84 /* Types.swift */; };
6969
DF28022620C2B15A00A1833B /* Types+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFF222CE20B99A6600AC2A84 /* Types+Description.swift */; };
7070
DF28022720C2B15B00A1833B /* Types+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFF222CE20B99A6600AC2A84 /* Types+Description.swift */; };
71+
DF46F684212442EE0055B081 /* PEdgeInsets+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFD2783E211A52C60056BD93 /* PEdgeInsets+Operators.swift */; };
72+
DF46F685212442EE0055B081 /* PEdgeInsets+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFD2783E211A52C60056BD93 /* PEdgeInsets+Operators.swift */; };
73+
DF46F686212442EF0055B081 /* PEdgeInsets+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFD2783E211A52C60056BD93 /* PEdgeInsets+Operators.swift */; };
7174
DF702D8E20D33BA90062045C /* PinLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF702D8A20D33BA90062045C /* PinLayout.swift */; };
7275
DF702D8F20D33BA90062045C /* PinLayout+WrapContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF702D8B20D33BA90062045C /* PinLayout+WrapContent.swift */; };
7376
DF702D9020D33BA90062045C /* PinLayout+Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF702D8C20D33BA90062045C /* PinLayout+Size.swift */; };
@@ -115,7 +118,6 @@
115118
DFB3ECB12061602F005F226B /* PinSafeArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB3ECB02061602E005F226B /* PinSafeArea.swift */; };
116119
DFB3ECB72062A937005F226B /* PinSafeArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB3ECB02061602E005F226B /* PinSafeArea.swift */; };
117120
DFCA5F1620111E0B00180CD7 /* UIScrollViewSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCA5F1420111BCF00180CD7 /* UIScrollViewSpec.swift */; };
118-
DFD2783F211A52C60056BD93 /* PEdgeInsets+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFD2783E211A52C60056BD93 /* PEdgeInsets+Operators.swift */; };
119121
DFEAF75020C9661B00E33147 /* ObjectiveCSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DFEAF74D20C965DC00E33147 /* ObjectiveCSpec.m */; };
120122
DFEAF75220C9661D00E33147 /* ObjectiveCSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DFEAF74D20C965DC00E33147 /* ObjectiveCSpec.m */; };
121123
DFED154F20852F7E009EF9A7 /* BasicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2469C5011E75D88500073BEE /* BasicView.swift */; };
@@ -863,6 +865,7 @@
863865
DF702D9F20D33CF20062045C /* PinLayout+Size.swift in Sources */,
864866
243C620A1FC37F6C0082C327 /* TypesImpl.swift in Sources */,
865867
C80435D920D08B7400EB1BD7 /* Layoutable+PinLayout.swift in Sources */,
868+
DF46F686212442EF0055B081 /* PEdgeInsets+Operators.swift in Sources */,
866869
DF702DA520D33CFA0062045C /* PinLayout+Layouting.swift in Sources */,
867870
DF702DA620D33CFA0062045C /* PinLayout+Warning.swift in Sources */,
868871
DF702DAF20D33D6A0062045C /* UIView+PinLayout.swift in Sources */,
@@ -893,7 +896,7 @@
893896
DF702D8E20D33BA90062045C /* PinLayout.swift in Sources */,
894897
DF702D9120D33BA90062045C /* PinLayout+Relative.swift in Sources */,
895898
241A277D1F8E958F00B1AD39 /* PinLayoutObjC.swift in Sources */,
896-
DFD2783F211A52C60056BD93 /* PEdgeInsets+Operators.swift in Sources */,
899+
DF46F684212442EE0055B081 /* PEdgeInsets+Operators.swift in Sources */,
897900
24949A2E1EF69474003643D3 /* Filters.swift in Sources */,
898901
DFB3ECB12061602F005F226B /* PinSafeArea.swift in Sources */,
899902
DF702DAB20D33D660062045C /* UIView+PinLayout.swift in Sources */,
@@ -980,6 +983,7 @@
980983
DF702D9B20D33CF10062045C /* PinLayout+Size.swift in Sources */,
981984
C80435D820D08B7300EB1BD7 /* Layoutable+PinLayout.swift in Sources */,
982985
DF1A5D432084CFD600725EF5 /* TypesImpl.swift in Sources */,
986+
DF46F685212442EE0055B081 /* PEdgeInsets+Operators.swift in Sources */,
983987
DF702DA220D33CF90062045C /* PinLayout+Layouting.swift in Sources */,
984988
DF702DA320D33CF90062045C /* PinLayout+Warning.swift in Sources */,
985989
DF702DAD20D33D6A0062045C /* UIView+PinLayout.swift in Sources */,

Sources/Extensions/PEdgeInsets+Operators.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11

22
public extension PEdgeInsets {
33
public func inset(_ value: CGFloat) -> PEdgeInsets {
4-
return UIEdgeInsets(top: self.top + value,
4+
return PEdgeInsets(top: self.top + value,
55
left: self.left + value,
66
bottom: self.bottom + value,
77
right: self.right + value)
88
}
99

10-
func insetBy(dx: CGFloat, dy: CGFloat) -> UIEdgeInsets {
11-
return UIEdgeInsets(top: self.top + dy, left: self.left + dx, bottom: self.bottom + dy, right: self.right + dx)
10+
func insetBy(dx: CGFloat, dy: CGFloat) -> PEdgeInsets {
11+
return PEdgeInsets(top: self.top + dy, left: self.left + dx, bottom: self.bottom + dy, right: self.right + dx)
1212
}
1313

14-
15-
func minInsets(_ insets: UIEdgeInsets) -> UIEdgeInsets {
16-
return UIEdgeInsets(top: minValue(self.top, minValue: insets.top),
14+
func minInsets(_ insets: PEdgeInsets) -> PEdgeInsets {
15+
return PEdgeInsets(top: minValue(self.top, minValue: insets.top),
1716
left: minValue(self.left, minValue: insets.left),
1817
bottom: minValue(self.bottom, minValue: insets.bottom),
1918
right: minValue(self.right, minValue: insets.right))
2019
}
2120

22-
func minInsets(dx: CGFloat, dy: CGFloat) -> UIEdgeInsets {
23-
return UIEdgeInsets(top: minValue(self.top, minValue: dy),
21+
func minInsets(dx: CGFloat, dy: CGFloat) -> PEdgeInsets {
22+
return PEdgeInsets(top: minValue(self.top, minValue: dy),
2423
left: minValue(self.left, minValue: dx),
2524
bottom: minValue(self.bottom, minValue: dy),
2625
right: minValue(self.right, minValue: dx))
@@ -30,10 +29,15 @@ public extension PEdgeInsets {
3029
return value >= minValue ? value : minValue
3130
}
3231
}
33-
//public func +(lhs: PEdgeInsets, rhs: Int) -> PEdgeInsets {
34-
// return lhs
35-
//}
36-
//
32+
33+
public func +(lhs: PEdgeInsets, rhs: Int) -> PEdgeInsets {
34+
let rhsf = CGFloat(rhs)
35+
return PEdgeInsets(top: lhs.top + rhsf,
36+
left: lhs.left + rhsf,
37+
bottom: lhs.bottom + rhsf,
38+
right: lhs.right + rhsf)
39+
}
40+
3741
public func +(lhs: PEdgeInsets, rhs: CGFloat) -> PEdgeInsets {
3842
return PEdgeInsets(top: lhs.top + rhs,
3943
left: lhs.left + rhs,

build-ci.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ time xcodebuild clean build -workspace PinLayout-iOS.xcworkspace -scheme PinLayo
4646
cd ../../..
4747

4848

49-
# echo "===============================" &&
50-
# echo " Cocoapods: macOS Empty project" &&
51-
# echo "===============================" &&
52-
# cd TestProjects/cocoapods/macos &&
53-
# rm -rf $DERIVED_DATA &&
54-
# pod install &&
55-
# time xcodebuild clean build -workspace PinLayout-macOS.xcworkspace -scheme PinLayout-macOS -sdk macosx10.13 -derivedDataPath $DERIVED_DATA \
56-
# | xcpretty &&
57-
# cd ../../..
49+
echo "===============================" &&
50+
echo " Cocoapods: macOS Empty project" &&
51+
echo "===============================" &&
52+
cd TestProjects/cocoapods/macos &&
53+
rm -rf $DERIVED_DATA &&
54+
pod install &&
55+
time xcodebuild clean build -workspace PinLayout-macOS.xcworkspace -scheme PinLayout-macOS -sdk macosx10.13 -derivedDataPath $DERIVED_DATA \
56+
| xcpretty &&
57+
cd ../../..
5858

5959

6060
echo "===============================" &&

0 commit comments

Comments
 (0)