Skip to content

Commit 6adef84

Browse files
authored
Merge pull request #138 from mirego/improve_objc_support
Add Objective-C support for macOS and tvOS
2 parents 4964630 + 4c6d513 commit 6adef84

File tree

15 files changed

+512
-608
lines changed

15 files changed

+512
-608
lines changed

PinLayout.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@
102102
DFED1552208533DA009EF9A7 /* AspectRatioTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 248E4C721F7A83FA00C0E7F7 /* AspectRatioTests.swift */; };
103103
DFED15532085349A009EF9A7 /* RectNimbleMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2469C5031E75DB7600073BEE /* RectNimbleMatcher.swift */; };
104104
DFED15542085349B009EF9A7 /* RectNimbleMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2469C5031E75DB7600073BEE /* RectNimbleMatcher.swift */; };
105+
DFF222B120B877F400AC2A84 /* PinLayoutObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241A277B1F8E958F00B1AD39 /* PinLayoutObjC.swift */; };
106+
DFF222B220B877F600AC2A84 /* PinLayoutObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241A277B1F8E958F00B1AD39 /* PinLayoutObjC.swift */; };
107+
DFF222B320B877F800AC2A84 /* PinLayoutObjCImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241A277C1F8E958F00B1AD39 /* PinLayoutObjCImpl.swift */; };
108+
DFF222B420B877F900AC2A84 /* PinLayoutObjCImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241A277C1F8E958F00B1AD39 /* PinLayoutObjCImpl.swift */; };
105109
DFF6F9C72084DCD3004F5AED /* PinLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 244DF2F81EF46C500090508B /* PinLayout.framework */; };
106110
DFF6F9CD2084E15A004F5AED /* BasicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2469C5011E75D88500073BEE /* BasicView.swift */; };
107111
DFF6F9CE2084E15A004F5AED /* AdjustSizeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2469C4FF1E75D74000073BEE /* AdjustSizeSpec.swift */; };
@@ -787,6 +791,8 @@
787791
buildActionMask = 2147483647;
788792
files = (
789793
243C62081FC37F6C0082C327 /* PinLayoutImpl+Warning.swift in Sources */,
794+
DFF222B420B877F900AC2A84 /* PinLayoutObjCImpl.swift in Sources */,
795+
DFF222B220B877F600AC2A84 /* PinLayoutObjC.swift in Sources */,
790796
24D18D261F3E5EA5008129EF /* Pin.swift in Sources */,
791797
DF1A5D362084CFC100725EF5 /* NSView+PinLayout.swift in Sources */,
792798
243C62041FC37F680082C327 /* PinLayoutImpl.swift in Sources */,
@@ -885,6 +891,8 @@
885891
buildActionMask = 2147483647;
886892
files = (
887893
DF1A5D3F2084CFD600725EF5 /* PinLayoutImpl+Warning.swift in Sources */,
894+
DFF222B320B877F800AC2A84 /* PinLayoutObjCImpl.swift in Sources */,
895+
DFF222B120B877F400AC2A84 /* PinLayoutObjC.swift in Sources */,
888896
DF1A5D3B2084CFD600725EF5 /* PinLayoutImpl.swift in Sources */,
889897
DF1A5D412084CFD600725EF5 /* Coordinates.swift in Sources */,
890898
DF1A5D422084CFD600725EF5 /* Percent.swift in Sources */,

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Nimble (7.0.3)
3-
- PinLayout (1.7.0)
3+
- PinLayout (1.7.3)
44
- Quick (1.2.0)
55
- Reveal-SDK (10)
66
- SwiftLint (0.25.1)
@@ -25,7 +25,7 @@ EXTERNAL SOURCES:
2525

2626
SPEC CHECKSUMS:
2727
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
28-
PinLayout: 816805698a6c478d5f0cf97dd298243c098d6e50
28+
PinLayout: 04488e8fc8d19b59760bdf99a16deff7bfac422d
2929
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
3030
Reveal-SDK: 7869ddf1f902cabbb07a1f0dd06bd25861a126f7
3131
SwiftLint: ce933681be10c3266e82576dad676fa815a602e9

Sources/Impl/PinLayoutImpl+Layouting.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,4 +443,3 @@ extension PinLayoutImpl {
443443
return view.isLTR()
444444
}
445445
}
446-

Sources/Impl/PinLayoutImpl+Relative.swift

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,21 @@ extension PinLayoutImpl {
2828
//
2929
// above(of ...)
3030
//
31-
@discardableResult
3231
func above(of relativeView: PView) -> PinLayout {
3332
func context() -> String { return "above(of: \(relativeView))" }
3433
return above(relativeViews: [relativeView], aligned: nil, context: context)
3534
}
36-
37-
@discardableResult
35+
3836
func above(of relativeViews: [PView]) -> PinLayout {
3937
func context() -> String { return "above(of: \(relativeViews))" }
4038
return above(relativeViews: relativeViews, aligned: nil, context: context)
4139
}
42-
43-
@discardableResult
40+
4441
func above(of relativeView: PView, aligned: HorizontalAlign) -> PinLayout {
4542
func context() -> String { return "above(of: \(relativeView), aligned: \(aligned))" }
4643
return above(relativeViews: [relativeView], aligned: aligned, context: context)
4744
}
48-
49-
@discardableResult
45+
5046
func above(of relativeViews: [PView], aligned: HorizontalAlign) -> PinLayout {
5147
func context() -> String { return "above(of: \(relativeViews), aligned: \(aligned))" }
5248
return above(relativeViews: relativeViews, aligned: aligned, context: context)
@@ -55,25 +51,21 @@ extension PinLayoutImpl {
5551
//
5652
// below(of ...)
5753
//
58-
@discardableResult
5954
func below(of relativeView: PView) -> PinLayout {
6055
func context() -> String { return "below(of: \(relativeView))" }
6156
return below(relativeViews: [relativeView], aligned: nil, context: context)
6257
}
63-
64-
@discardableResult
58+
6559
func below(of relativeViews: [PView]) -> PinLayout {
6660
func context() -> String { return "below(of: \(relativeViews))" }
6761
return below(relativeViews: relativeViews, aligned: nil, context: context)
6862
}
69-
70-
@discardableResult
63+
7164
func below(of relativeView: PView, aligned: HorizontalAlign) -> PinLayout {
7265
func context() -> String { return "below(of: \(relativeView), aligned: \(aligned))" }
7366
return below(relativeViews: [relativeView], aligned: aligned, context: context)
7467
}
75-
76-
@discardableResult
68+
7769
func below(of relativeViews: [PView], aligned: HorizontalAlign) -> PinLayout {
7870
func context() -> String { return "below(of: \(relativeViews), aligned: \(aligned))" }
7971
return below(relativeViews: relativeViews, aligned: aligned, context: context)
@@ -82,25 +74,21 @@ extension PinLayoutImpl {
8274
//
8375
// left(of ...)
8476
//
85-
@discardableResult
8677
func left(of relativeView: PView) -> PinLayout {
8778
func context() -> String { return "left(of: \(relativeView))" }
8879
return left(relativeViews: [relativeView], aligned: nil, context: context)
8980
}
90-
91-
@discardableResult
81+
9282
func left(of relativeViews: [PView]) -> PinLayout {
9383
func context() -> String { return "left(of: \(relativeViews))" }
9484
return left(relativeViews: relativeViews, aligned: nil, context: context)
9585
}
96-
97-
@discardableResult
86+
9887
func left(of relativeView: PView, aligned: VerticalAlign) -> PinLayout {
9988
func context() -> String { return "left(of: \(relativeView), aligned: \(aligned))" }
10089
return left(relativeViews: [relativeView], aligned: aligned, context: context)
10190
}
102-
103-
@discardableResult
91+
10492
func left(of relativeViews: [PView], aligned: VerticalAlign) -> PinLayout {
10593
func context() -> String { return "left(of: \(relativeViews), aligned: \(aligned))" }
10694
return left(relativeViews: relativeViews, aligned: aligned, context: context)
@@ -109,31 +97,26 @@ extension PinLayoutImpl {
10997
//
11098
// right(of ...)
11199
//
112-
@discardableResult
113100
func right(of relativeView: PView) -> PinLayout {
114101
func context() -> String { return "right(of: \(relativeView))" }
115102
return right(relativeViews: [relativeView], aligned: nil, context: context)
116103
}
117-
118-
@discardableResult
104+
119105
func right(of relativeViews: [PView]) -> PinLayout {
120106
func context() -> String { return "right(of: \(relativeViews))" }
121107
return right(relativeViews: relativeViews, aligned: nil, context: context)
122108
}
123109

124-
@discardableResult
125110
func right(of relativeView: PView, aligned: VerticalAlign) -> PinLayout {
126111
func context() -> String { return "right(of: \(relativeView), aligned: \(aligned))" }
127112
return right(relativeViews: [relativeView], aligned: aligned, context: context)
128113
}
129-
130-
@discardableResult
114+
131115
func right(of relativeViews: [PView], aligned: VerticalAlign) -> PinLayout {
132116
func context() -> String { return "right(of: \(relativeViews), aligned: \(aligned))" }
133117
return right(relativeViews: relativeViews, aligned: aligned, context: context)
134118
}
135-
136-
@discardableResult
119+
137120
func before(of relativeView: PView) -> PinLayout {
138121
func context() -> String { return "before(of: \(relativeView))" }
139122
if isLTR() {
@@ -142,8 +125,7 @@ extension PinLayoutImpl {
142125
return right(relativeViews: [relativeView], aligned: nil, context: context)
143126
}
144127
}
145-
146-
@discardableResult
128+
147129
func before(of relativeViews: [PView]) -> PinLayout {
148130
func context() -> String { return "before(of: \(relativeViews))" }
149131
if isLTR() {
@@ -152,8 +134,7 @@ extension PinLayoutImpl {
152134
return right(relativeViews: relativeViews, aligned: nil, context: context)
153135
}
154136
}
155-
156-
@discardableResult
137+
157138
func before(of relativeView: PView, aligned: VerticalAlign) -> PinLayout {
158139
func context() -> String { return "before(of: \(relativeView), aligned: \(aligned))" }
159140
if isLTR() {
@@ -162,8 +143,7 @@ extension PinLayoutImpl {
162143
return right(relativeViews: [relativeView], aligned: aligned, context: context)
163144
}
164145
}
165-
166-
@discardableResult
146+
167147
func before(of relativeViews: [PView], aligned: VerticalAlign) -> PinLayout {
168148
func context() -> String { return "before(of: \(relativeViews), aligned: \(aligned))" }
169149
if isLTR() {
@@ -172,8 +152,7 @@ extension PinLayoutImpl {
172152
return right(relativeViews: relativeViews, aligned: aligned, context: context)
173153
}
174154
}
175-
176-
@discardableResult
155+
177156
func after(of relativeView: PView) -> PinLayout {
178157
func context() -> String { return "after(of: \(relativeView))" }
179158
if isLTR() {
@@ -182,8 +161,7 @@ extension PinLayoutImpl {
182161
return left(relativeViews: [relativeView], aligned: nil, context: context)
183162
}
184163
}
185-
186-
@discardableResult
164+
187165
func after(of relativeViews: [PView]) -> PinLayout {
188166
func context() -> String { return "after(of: \(relativeViews))" }
189167
if isLTR() {
@@ -192,8 +170,7 @@ extension PinLayoutImpl {
192170
return left(relativeViews: relativeViews, aligned: nil, context: context)
193171
}
194172
}
195-
196-
@discardableResult
173+
197174
func after(of relativeView: PView, aligned: VerticalAlign) -> PinLayout {
198175
func context() -> String { return "after(of: \(relativeView))" }
199176
if isLTR() {
@@ -202,8 +179,7 @@ extension PinLayoutImpl {
202179
return left(relativeViews: [relativeView], aligned: aligned, context: context)
203180
}
204181
}
205-
206-
@discardableResult
182+
207183
func after(of relativeViews: [PView], aligned: VerticalAlign) -> PinLayout {
208184
func context() -> String { return "after(of: \(relativeViews), aligned: \(aligned))" }
209185
if isLTR() {
@@ -216,7 +192,6 @@ extension PinLayoutImpl {
216192

217193
// MARK: fileprivate
218194
extension PinLayoutImpl {
219-
@discardableResult
220195
fileprivate func above(relativeViews: [PView], aligned: HorizontalAlign?, context: Context) -> PinLayout {
221196
guard let relativeViews = validateRelativeViews(relativeViews, context: context) else { return self }
222197

@@ -240,7 +215,6 @@ extension PinLayoutImpl {
240215
return self
241216
}
242217

243-
@discardableResult
244218
fileprivate func below(relativeViews: [PView], aligned: HorizontalAlign?, context: Context) -> PinLayout {
245219
guard let relativeViews = validateRelativeViews(relativeViews, context: context) else { return self }
246220

@@ -391,4 +365,3 @@ extension PinLayoutImpl {
391365
return relativeViews
392366
}
393367
}
394-

Sources/Impl/PinLayoutImpl+Warning.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,3 @@ extension PinLayoutImpl {
157157
return "UIEdgeInsets(top: \(insets.top), left: \(insets.left), bottom: \(insets.bottom), right: \(insets.right))"
158158
}
159159
}
160-

0 commit comments

Comments
 (0)