Skip to content

Commit 0029365

Browse files
committed
Merge branch 'master' into rename_keyBoardArea
# Conflicts: # Sources/PinLayout.swift
2 parents 1fca80a + 65fc484 commit 0029365

File tree

10 files changed

+101
-177
lines changed

10 files changed

+101
-177
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: GitHub Actions CI
2+
on: [push]
3+
jobs:
4+
CI:
5+
runs-on: macos-latest
6+
# env:
7+
# DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
12+
- run: bundle install
13+
- run: pod install --repo-update
14+
15+
- name: Set Xcode Version 13.2.1
16+
run: sudo xcode-select -s /Applications/Xcode_13.2.1.app
17+
18+
- name: Build PinLayout-iOS
19+
run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-iOS -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty
20+
21+
- name: Build PinLayout-tvOS
22+
run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-tvOS -sdk appletvsimulator15.2 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=15.2' | xcpretty
23+
24+
- name: Build PinLayout-macOS
25+
run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-macOS -sdk macosx12.1 | xcpretty
26+
27+
- name: Build PinLayoutSample - iOS 15.2
28+
run: set -o pipefail && xcodebuild build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty
29+
30+
- name: iOS unit tests
31+
run: set -o pipefail && xcodebuild build test -workspace PinLayout.xcworkspace -scheme PinLayout-iOS -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty
32+
33+
# # - name: tvOS unit tests
34+
# # run: set -o pipefail && xcodebuild build test -workspace PinLayout.xcworkspace -scheme PinLayout-tvOS -sdk appletvos15.2 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=15.2' | xcpretty
35+
36+
# # - name: macOS unit tests
37+
# # run: set -o pipefail && xcodebuild test -workspace PinLayout.xcworkspace -scheme PinLayout-macOS -sdk macosx12.1 -destination 'platform=macOS,name=Any Mac' | xcpretty
38+
39+
- name: Cocoapods - iOS Empty project
40+
run: set -o pipefail && cd TestProjects/cocoapods/ios && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-iOS.xcworkspace -scheme PinLayout-iOS -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty && cd ../../..
41+
42+
# - name: Cocoapods - macOS Empty project
43+
# run: set -o pipefail && cd TestProjects/cocoapods/macos && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-macOS.xcworkspace -scheme PinLayout-macOS -sdk macosx12.1 | xcpretty && cd ../../..
44+
45+
# - name: Cocoapods - tvOS Empty project
46+
# run: set -o pipefail && cd TestProjects/cocoapods/tvos && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-tvOS.xcworkspace -scheme PinLayout-tvOS -sdk appletvsimulator15.2 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=15.2' | xcpretty && cd ../../..
47+
48+
# - name: Carthage - iOS Empty project
49+
# run: set -o pipefail && cd TestProjects/carthage/ios && rm Cartfile && echo "git \"file:///$BASEDIR\"" > Cartfile && carthage update --use-ssh --platform iOS --use-xcframeworks && xcodebuild build -project PinLayout-Carthage-iOS.xcodeproj -scheme PinLayout-Carthage-iOS -sdk iphonesimulator15.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.2' | xcpretty && rm Cartfile.resolved && cd ../../..
50+
51+
- name: Swift Package Manager - iOS Empty project
52+
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 ../../..
53+
54+
- name: Set XCode Version 12.5.1 (iOS 14)
55+
run: sudo xcode-select -s /Applications/Xcode_12.5.1.app
56+
- name: Build PinLayoutSample - iOS 14.5
57+
run: set -o pipefail && xcodebuild clean build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator14.5 -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.5' | xcpretty
58+
59+
- name: Set XCode Version 11.7 (iOS 13)
60+
run: sudo xcode-select -s /Applications/Xcode_11.7.app
61+
- name: Build PinLayoutSample - iOS 13.7
62+
run: set -o pipefail && xcodebuild clean build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator13.7 -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.7' | xcpretty
63+
64+
- name: Pod lib lint
65+
run: set -o pipefail && bundle exec pod lib lint --allow-warnings
66+
67+
- run: echo "🍏 This job's status is ${{ job.status }}."

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

Example/PinLayoutSample/UI/Menu/MenuView.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,14 @@ extension MenuView: UITableViewDelegate {
7676
tableView.deselectRow(at: indexPath, animated: true)
7777
}
7878
}
79+
80+
// MARK: PinLayout validation
81+
extension MenuView {
82+
private func validation() {
83+
// Compilation validation
84+
#if compiler(>=5.5) // Xcode 13+
85+
// iOS 15+
86+
_ = tableView.pin.keyboardArea
87+
#endif
88+
}
89+
}

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
source 'https://rubygems.org'
22
gem 'cocoapods', '~> 1.7'
3-
gem 'jazzy', '0.9'
4-
gem 'xcpretty-travis-formatter'

Gemfile.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ GEM
110110
colored2 (~> 3.1)
111111
nanaimo (~> 0.3.0)
112112
rexml (~> 3.2.4)
113-
xcpretty (0.2.6)
114-
rouge (~> 1.8)
115-
xcpretty-travis-formatter (1.0.1)
116-
xcpretty (~> 0.2, >= 0.0.7)
117113
zeitwerk (2.5.4)
118114

119115
PLATFORMS
@@ -122,7 +118,6 @@ PLATFORMS
122118
DEPENDENCIES
123119
cocoapods (~> 1.7)
124120
jazzy (= 0.9)
125-
xcpretty-travis-formatter
126121

127122
BUNDLED WITH
128123
2.2.33

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Nimble (9.2.1)
3-
- PinLayout (1.10.0)
3+
- PinLayout (1.10.1)
44
- Quick (4.0.0)
55
- SwiftLint (0.46.2)
66

@@ -22,7 +22,7 @@ EXTERNAL SOURCES:
2222

2323
SPEC CHECKSUMS:
2424
Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5
25-
PinLayout: e50e9a748b632905fca6e67043ea4b05d6c92186
25+
PinLayout: 8b3199b283d1b34e6b35a71d0202049b67551c96
2626
Quick: 6473349e43b9271a8d43839d9ba1c442ed1b7ac4
2727
SwiftLint: 6bc52a21f0fd44cab9aa2dc8e534fb9f5e3ec507
2828

Sources/PinLayout.swift

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

118-
#if os(iOS)
118+
#if os(iOS) && compiler(>=5.5) // Xcode 13+
119119
public var keyboardArea: CGRect {
120120
guard #available(iOS 15.0, *) else { return .zero }
121121
guard let view = view as? UIView else { return .zero }

TestProjects/cocoapods/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- PinLayout (1.10.0)
2+
- PinLayout (1.10.1)
33
- SwifterSwift (5.0.0):
44
- SwifterSwift/AppKit (= 5.0.0)
55
- SwifterSwift/CoreGraphics (= 5.0.0)
@@ -33,7 +33,7 @@ EXTERNAL SOURCES:
3333
:path: "../../.."
3434

3535
SPEC CHECKSUMS:
36-
PinLayout: e50e9a748b632905fca6e67043ea4b05d6c92186
36+
PinLayout: 8b3199b283d1b34e6b35a71d0202049b67551c96
3737
SwifterSwift: 96f90594b370802f01647c2b1229c74a84ffafee
3838

3939
PODFILE CHECKSUM: 3eeeff509b48ae95b0ba6a131fc224e3d13ac363

Tests/iOS/ReadableLayoutMarginsSpec.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class ReadableLayoutMargins: QuickSpec {
8585

8686
#if os(iOS)
8787
expect(aView.frame).to(equal(CGRect(x: 8, y: 8, width: 384.0, height: 384.0)))
88+
#elseif os(tvOS)
89+
expect(aView.frame).to(equal(CGRect(x: 88, y: 68, width: 304.0, height: 324.0)))
8890
#else
8991
expect(aView.frame).to(equal(CGRect(x: 98, y: 68, width: 294.0, height: 324.0)))
9092
#endif
@@ -99,10 +101,26 @@ class ReadableLayoutMargins: QuickSpec {
99101

100102
#if os(iOS)
101103
expect(aView.frame).to(equal(CGRect(x: 8, y: 8, width: 384.0, height: 384.0)))
104+
#elseif os(tvOS)
105+
expect(aView.frame).to(equal(CGRect(x: 88, y: 68, width: 304.0, height: 324.0)))
102106
#else
103107
expect(aView.frame).to(equal(CGRect(x: 98, y: 68, width: 294.0, height: 324.0)))
104108
#endif
105109
}
106110
}
111+
112+
#if os(iOS) && compiler(>=5.5)
113+
describe("Using pin.keyboardArea") {
114+
it("test") {
115+
setupWindow(with: viewController)
116+
117+
rootView.pin.top(0).horizontally()
118+
rootView.pin.bottom(rootView.pin.keyboardArea.minY)
119+
120+
expect(rootView.frame).to(equal(CGRect(x: 0, y: 267, width: 375, height: 400)))
121+
expect(rootView.pin.keyboardArea).to(equal(CGRect(x: 0, y: 0, width: 0, height: 0)))
122+
}
123+
}
124+
#endif
107125
}
108126
}

build-ci.sh

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)