Skip to content

Commit 1065ce8

Browse files
authored
Merge pull request #172 from layoutBox/between
Add methods to layout a view between two other views
2 parents 5112cd3 + 94d7efa commit 1065ce8

20 files changed

+1076
-199
lines changed

Example/PinLayoutSample/UI/Examples/AutoAdjustingSize/AutoAdjustingSizeView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ class AutoAdjustingSizeView: UIView {
7878
contentScrollView.pin.all()
7979

8080
row1.pin.top().horizontally(pin.safeArea).height(40)
81-
row1Item1.pin.top().left().bottom().width(50).margin(2)
81+
row1Item1.pin.vertically().left().width(50).margin(2)
8282
row1Item2.pin.right(of: row1Item1, aligned: .top).bottomRight().margin(0, 2, 2, 2)
8383

8484
row2.pin.below(of: row1, aligned: .left).size(of: row1).marginTop(10)
85-
row2Item1.pin.top().bottom().right().width(150).margin(2)
85+
row2Item1.pin.vertically().right().width(150).margin(2)
8686
row2Item2.pin.left(of: row2Item1, aligned: .top).left().bottom().margin(0, 2, 2, 2)
8787

8888
row3.pin.below(of: row2, aligned: .left).size(of: row1).marginTop(10)

Example/PinLayoutSample/UI/Examples/Form/FormView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ class FormView: BaseFormView {
8282

8383
formTitleLabel.pin.topCenter().margin(margin)
8484

85-
nameField.pin.below(of: formTitleLabel).left().right().height(40).margin(margin)
85+
nameField.pin.below(of: formTitleLabel).horizontally().height(40).margin(margin)
8686

87-
ageSwitch.pin.below(of: nameField).left().right().height(40).margin(margin)
88-
ageField.pin.below(of: ageSwitch).left().right().height(40).margin(margin)
87+
ageSwitch.pin.below(of: nameField).horizontally().height(40).margin(margin)
88+
ageField.pin.below(of: ageSwitch).horizontally().height(40).margin(margin)
8989

9090
// Layout the Address UITextField below the last visible view, either ageSwitch or ageField.
91-
addressField.pin.below(of: visible([ageSwitch, ageField])).left().right().height(40).margin(margin)
91+
addressField.pin.below(of: visible([ageSwitch, ageField])).horizontally().height(40).margin(margin)
9292

9393
// Adjust the form container bottom to contains all its childrens
9494
formContainerView.pin.height(addressField.frame.maxY + margin)

Example/PinLayoutSample/UI/Menu/MenuViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class MenuViewController: UIViewController {
119119

120120
override func viewDidAppear(_ animated: Bool) {
121121
super.viewDidAppear(true)
122-
//didSelect(pageType: .safeArea)
122+
// didSelect(pageType: .intro)
123123
}
124124
}
125125

PinLayout.xcodeproj/project.pbxproj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
C8C4928D20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C4928C20DA7DA700048357 /* CALayer+PinLayout.swift */; };
5656
C8C4928E20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C4928C20DA7DA700048357 /* CALayer+PinLayout.swift */; };
5757
C8C4928F20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C4928C20DA7DA700048357 /* CALayer+PinLayout.swift */; };
58+
DF10846C212D8B5900C23B80 /* BetweenSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846A212D8B4B00C23B80 /* BetweenSpec.swift */; };
59+
DF10846D212D8B5900C23B80 /* BetweenSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846A212D8B4B00C23B80 /* BetweenSpec.swift */; };
60+
DF10846E212D8B5900C23B80 /* BetweenSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846A212D8B4B00C23B80 /* BetweenSpec.swift */; };
61+
DF108470212D8E8700C23B80 /* PinLayout+Between.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846F212D8E8700C23B80 /* PinLayout+Between.swift */; };
5862
DF1A5D202084C94700725EF5 /* PinLayoutTestMacOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF1A5D1F2084C94700725EF5 /* PinLayoutTestMacOS.swift */; };
5963
DF1A5D302084CF9700725EF5 /* PinLayoutMacOS.h in Headers */ = {isa = PBXBuildFile; fileRef = DF1A5D2E2084CF9700725EF5 /* PinLayoutMacOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
6064
DF1A5D382084CFC600725EF5 /* Filters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24949A2D1EF69474003643D3 /* Filters.swift */; };
@@ -119,6 +123,8 @@
119123
DFB3ECB72062A937005F226B /* PinSafeArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB3ECB02061602E005F226B /* PinSafeArea.swift */; };
120124
DFBCAF01213023D10025F7BF /* ReadableLayoutMarginsSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFBCAEFF213023700025F7BF /* ReadableLayoutMarginsSpec.swift */; };
121125
DFBCAF02213023D30025F7BF /* ReadableLayoutMarginsSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFBCAEFF213023700025F7BF /* ReadableLayoutMarginsSpec.swift */; };
126+
DFBCAF1A2132C55A0025F7BF /* PinLayout+Between.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846F212D8E8700C23B80 /* PinLayout+Between.swift */; };
127+
DFBCAF1B2132C55B0025F7BF /* PinLayout+Between.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF10846F212D8E8700C23B80 /* PinLayout+Between.swift */; };
122128
DFCA5F1620111E0B00180CD7 /* UIScrollViewSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCA5F1420111BCF00180CD7 /* UIScrollViewSpec.swift */; };
123129
DFEAF75020C9661B00E33147 /* ObjectiveCSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DFEAF74D20C965DC00E33147 /* ObjectiveCSpec.m */; };
124130
DFEAF75220C9661D00E33147 /* ObjectiveCSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DFEAF74D20C965DC00E33147 /* ObjectiveCSpec.m */; };
@@ -231,6 +237,8 @@
231237
C83600A520E2949200A3D891 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; usesTabs = 1; };
232238
C8BDEE8FC7F6D6F36D69AE89 /* Pods-PinLayoutTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PinLayoutTests-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PinLayoutTests-iOS/Pods-PinLayoutTests-iOS.debug.xcconfig"; sourceTree = "<group>"; };
233239
C8C4928C20DA7DA700048357 /* CALayer+PinLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CALayer+PinLayout.swift"; sourceTree = "<group>"; };
240+
DF10846A212D8B4B00C23B80 /* BetweenSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BetweenSpec.swift; sourceTree = "<group>"; };
241+
DF10846F212D8E8700C23B80 /* PinLayout+Between.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PinLayout+Between.swift"; sourceTree = "<group>"; };
234242
DF1A5D1D2084C94700725EF5 /* PinLayoutTests-macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PinLayoutTests-macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
235243
DF1A5D1F2084C94700725EF5 /* PinLayoutTestMacOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinLayoutTestMacOS.swift; sourceTree = "<group>"; };
236244
DF1A5D2C2084CF9700725EF5 /* PinLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PinLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -373,6 +381,7 @@
373381
C80435D420D0898000EB1BD7 /* Layoutable+PinLayout.swift */,
374382
24D18D231F3E37DD008129EF /* Pin.swift */,
375383
DF702D8A20D33BA90062045C /* PinLayout.swift */,
384+
DF10846F212D8E8700C23B80 /* PinLayout+Between.swift */,
376385
DF702D8D20D33BA90062045C /* PinLayout+Relative.swift */,
377386
DF702D8C20D33BA90062045C /* PinLayout+Size.swift */,
378387
DF702D8B20D33BA90062045C /* PinLayout+WrapContent.swift */,
@@ -453,6 +462,8 @@
453462
children = (
454463
2469C4FF1E75D74000073BEE /* AdjustSizeSpec.swift */,
455464
248E4C721F7A83FA00C0E7F7 /* AspectRatioTests.swift */,
465+
DF10846A212D8B4B00C23B80 /* BetweenSpec.swift */,
466+
C83588BF20DBC5E600D6E8F9 /* CALayerSpec.swift */,
456467
240F88BC1F0C042500280FC8 /* JustifyAlignSpec.swift */,
457468
243B12C41FC3CFC10072A9C3 /* LayoutMethodSpec.swift */,
458469
244C6E141E776A0C0074FC74 /* MarginsSpec.swift */,
@@ -466,7 +477,6 @@
466477
242E8DC11EED5982005935FB /* RelativePositionMultipleViewsSpec.swift */,
467478
240F88BF1F0C1ED900280FC8 /* WarningSpec.swift */,
468479
DFF222E120BACBA800AC2A84 /* WrapContentSpec.swift */,
469-
C83588BF20DBC5E600D6E8F9 /* CALayerSpec.swift */,
470480
);
471481
path = Common;
472482
sourceTree = "<group>";
@@ -854,6 +864,7 @@
854864
C8C4928F20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */,
855865
DF28022720C2B15B00A1833B /* Types+Description.swift in Sources */,
856866
DFF222B220B877F600AC2A84 /* PinLayoutObjC.swift in Sources */,
867+
DFBCAF1B2132C55B0025F7BF /* PinLayout+Between.swift in Sources */,
857868
DF702D9E20D33CF20062045C /* PinLayout+Relative.swift in Sources */,
858869
24D18D261F3E5EA5008129EF /* Pin.swift in Sources */,
859870
DF28022420C2B13800A1833B /* Types.swift in Sources */,
@@ -885,6 +896,7 @@
885896
C8C4928D20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */,
886897
DFF222CF20B99A6600AC2A84 /* Types+Description.swift in Sources */,
887898
DFF222CD20B999BD00AC2A84 /* Types.swift in Sources */,
899+
DF108470212D8E8700C23B80 /* PinLayout+Between.swift in Sources */,
888900
243C620F1FC3834B0082C327 /* Percent.swift in Sources */,
889901
2475B6CF1FC37C570054CADD /* TypesImpl.swift in Sources */,
890902
DF702D9020D33BA90062045C /* PinLayout+Size.swift in Sources */,
@@ -913,6 +925,7 @@
913925
buildActionMask = 2147483647;
914926
files = (
915927
DFF222E320BACBBF00AC2A84 /* WrapContentSpec.swift in Sources */,
928+
DF10846C212D8B5900C23B80 /* BetweenSpec.swift in Sources */,
916929
240F88BE1F0C066800280FC8 /* JustifyAlignSpec.swift in Sources */,
917930
2469C5001E75D74000073BEE /* AdjustSizeSpec.swift in Sources */,
918931
C83588C120DBC65500D6E8F9 /* CALayerSpec.swift in Sources */,
@@ -944,6 +957,7 @@
944957
buildActionMask = 2147483647;
945958
files = (
946959
DFB288A520853F3C001F9588 /* MarginsSpec.swift in Sources */,
960+
DF10846D212D8B5900C23B80 /* BetweenSpec.swift in Sources */,
947961
DF1A5D202084C94700725EF5 /* PinLayoutTestMacOS.swift in Sources */,
948962
DFED15502085304B009EF9A7 /* AdjustSizeSpec.swift in Sources */,
949963
DFED154F20852F7E009EF9A7 /* BasicView.swift in Sources */,
@@ -973,6 +987,7 @@
973987
C8C4928E20DA7DA700048357 /* CALayer+PinLayout.swift in Sources */,
974988
DF28022620C2B15A00A1833B /* Types+Description.swift in Sources */,
975989
DFF222B120B877F400AC2A84 /* PinLayoutObjC.swift in Sources */,
990+
DFBCAF1A2132C55A0025F7BF /* PinLayout+Between.swift in Sources */,
976991
DF702D9A20D33CF10062045C /* PinLayout+Relative.swift in Sources */,
977992
DF28022520C2B13900A1833B /* Types.swift in Sources */,
978993
DF1A5D412084CFD600725EF5 /* Coordinates.swift in Sources */,
@@ -1014,6 +1029,7 @@
10141029
DFF6F9DD2084E15A004F5AED /* TransformSpec.swift in Sources */,
10151030
C83588C320DBC65600D6E8F9 /* CALayerSpec.swift in Sources */,
10161031
DFF6F9D32084E15A004F5AED /* MinMaxWidthHeightSpec.swift in Sources */,
1032+
DF10846E212D8B5900C23B80 /* BetweenSpec.swift in Sources */,
10171033
DFF6F9CD2084E15A004F5AED /* BasicView.swift in Sources */,
10181034
DFBCAF02213023D30025F7BF /* ReadableLayoutMarginsSpec.swift in Sources */,
10191035
DFF6F9DA2084E15A004F5AED /* RTLSpec.swift in Sources */,

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Nimble (7.0.3)
3-
- PinLayout (1.7.12)
3+
- PinLayout (1.8.2)
44
- Quick (1.2.0)
55
- Reveal-SDK (17)
66
- SwiftLint (0.27.0)
@@ -13,7 +13,7 @@ DEPENDENCIES:
1313
- SwiftLint
1414

1515
SPEC REPOS:
16-
https://github.com/cocoapods/specs.git:
16+
https://github.com/CocoaPods/Specs.git:
1717
- Nimble
1818
- Quick
1919
- Reveal-SDK
@@ -25,11 +25,11 @@ EXTERNAL SOURCES:
2525

2626
SPEC CHECKSUMS:
2727
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
28-
PinLayout: 4922b1c70da60d5bff2e7fb4116deb1ddc759927
28+
PinLayout: 5a9631809bf246dfa39ff23d90eafb85e6243e4b
2929
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
3030
Reveal-SDK: a6df49f47319bd19a110c960c498af32df72c0af
3131
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
3232

3333
PODFILE CHECKSUM: 62618887f8155abc1ed3348d9b676cf6915137e2
3434

35-
COCOAPODS: 1.5.3
35+
COCOAPODS: 1.5.0

0 commit comments

Comments
 (0)