Skip to content

Commit fe282ff

Browse files
committed
Update
1 parent cbf4ddb commit fe282ff

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/github-actions-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- run: bundle install
1313
- run: pod install --repo-update
1414

15-
- name: Set XCode Version
15+
- name: Set Xcode Version 13.2.1
1616
run: sudo xcode-select -s /Applications/Xcode_13.2.1.app
1717

1818
- name: Build PinLayout-iOS
@@ -54,11 +54,15 @@ jobs:
5454
# - name: Swift Package Manager - iOS Empty project
5555
# run: set -o pipefail && cd TestProjects/swift-package-manager/ios && rm -rf .build && xcodebuild build -project PinLayout-SPM-iOS.xcodeproj -scheme PinLayout-SPM-iOS -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty && cd ../../..
5656

57-
- name: Set XCode Version
57+
- name: Set XCode Version 12.5.1
5858
run: sudo xcode-select -s /Applications/Xcode_12.5.1.app
5959
- name: Build PinLayoutSample - iOS 14.5
6060
run: set -o pipefail && xcodebuild build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator14.5 -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.5' | xcpretty
6161

62+
- name: Set XCode Version 11.7
63+
run: sudo xcode-select -s /Applications/Xcode_11.7.app
64+
- name: Build PinLayoutSample - iOS 13.7
65+
run: set -o pipefail && xcodebuild build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator13.7 -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.7' | xcpretty
6266

6367

6468
- name: Pod lib lint

Sources/PinLayout.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ public class PinLayout<View: Layoutable> {
115115
}
116116
#endif
117117

118-
#if os(iOS)
118+
#if os(iOS) && compiler(>=5.5)
119119
public var keyboardMargins: PEdgeInsets {
120+
120121
guard #available(iOS 15.0, *) else { return .zero }
121122
guard let view = view as? UIView else { return .zero }
122123

Tests/iOS/ReadableLayoutMarginsSpec.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,18 @@ class ReadableLayoutMargins: QuickSpec {
108108
#endif
109109
}
110110
}
111+
112+
#if os(iOS) && compiler(>=5.5)
113+
describe("Using pin.keyboardMargins") {
114+
it("test") {
115+
setupWindow(with: viewController)
116+
117+
rootView.pin.top(0).horizontally()
118+
rootView.pin.bottom(rootView.pin.keyboardMargins.top)
119+
120+
expect(rootView.frame).to(equal(CGRect(x: 0, y: 267, width: 375, height: 400)))
121+
}
122+
}
123+
#endif
111124
}
112125
}

0 commit comments

Comments
 (0)