Skip to content

Commit 69b271a

Browse files
authored
Merge pull request #30 from ww-tech/sgrosmark/feature/ios14
Tweaks for iOS 14 & Xcode 12
2 parents 2f3bcde + 23a1412 commit 69b271a

File tree

9 files changed

+46
-44
lines changed

9 files changed

+46
-44
lines changed

.circleci/config.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ commands:
2020
keys:
2121
- gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
2222
- gem-cache-v1-{{ arch }}-{{ .Branch }}
23+
- run:
24+
name: Configure bundler
25+
command: bundle config set path ~/vendor/bundle
2326
- run:
2427
name: Install dependencies in Gemfile
25-
command: bundle install --path vendor/bundle
28+
command: bundle install
2629
- save_cache:
2730
key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
2831
paths:
29-
- vendor/bundle
32+
- ~/vendor/bundle
3033

3134
# Installs all dependencies needed for a job
3235
install_dependencies:
@@ -59,7 +62,7 @@ jobs:
5962
build-gem-cache:
6063
<<: *defaults
6164
macos:
62-
xcode: 10.3.0
65+
xcode: 11.3.0
6366
steps:
6467
- checkout
6568
- setup_ruby
@@ -109,6 +112,20 @@ jobs:
109112
swift: '5.2'
110113
device: 'iPhone XS'
111114

115+
build-and-test-swift53:
116+
<<: *defaults
117+
macos:
118+
xcode: 12.0.0
119+
steps:
120+
- checkout
121+
- install_dependencies
122+
- build:
123+
swift: '5.3'
124+
device: 'iPhone 8'
125+
- build:
126+
swift: '5.3'
127+
device: 'iPhone SE'
128+
112129
build-and-test-swiftpm:
113130
<<: *defaults
114131
macos:
@@ -139,6 +156,9 @@ workflows:
139156
- build-and-test-swift52:
140157
requires:
141158
- build-gem-cache
159+
- build-and-test-swift53:
160+
requires:
161+
- build-gem-cache
142162
- build-and-test-swiftpm:
143163
requires:
144164
- build-gem-cache

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Gemfile
22
source 'https://rubygems.org'
33

4-
gem 'slather', '>= 2.4.7'
4+
#gem 'slather', '>= 2.4.7'

Gemfile.lock

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,11 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.2)
5-
activesupport (4.2.11.1)
6-
i18n (~> 0.7)
7-
minitest (~> 5.1)
8-
thread_safe (~> 0.3, >= 0.3.4)
9-
tzinfo (~> 1.1)
10-
atomos (0.1.3)
11-
claide (1.0.3)
12-
clamp (1.3.1)
13-
colored2 (3.1.2)
14-
concurrent-ruby (1.1.6)
15-
i18n (0.9.5)
16-
concurrent-ruby (~> 1.0)
17-
mini_portile2 (2.4.0)
18-
minitest (5.14.0)
19-
nanaimo (0.2.6)
20-
nokogiri (1.10.8)
21-
mini_portile2 (~> 2.4.0)
22-
slather (2.4.7)
23-
CFPropertyList (>= 2.2, < 4)
24-
activesupport (>= 4.0.2, < 5)
25-
clamp (~> 1.3)
26-
nokogiri (~> 1.8)
27-
xcodeproj (~> 1.7)
28-
thread_safe (0.3.6)
29-
tzinfo (1.2.6)
30-
thread_safe (~> 0.1)
31-
xcodeproj (1.15.0)
32-
CFPropertyList (>= 2.3.3, < 4.0)
33-
atomos (~> 0.1.3)
34-
claide (>= 1.0.2, < 2.0)
35-
colored2 (~> 3.1)
36-
nanaimo (~> 0.2.6)
374

385
PLATFORMS
396
ruby
407

418
DEPENDENCIES
42-
slather (>= 2.4.7)
439

4410
BUNDLED WITH
4511
2.1.4

Sources/WWLayout/Anchorable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ public enum SpecialAnchorable {
104104
return superview
105105

106106
case .margins:
107-
// constraing a view to margins means constraining it to it's superview's layoutMarginsGuide
107+
// constraining a view to margins means constraining it to it's superview's layoutMarginsGuide
108108
if superview.next == nil {
109109
print("WARNING: using .margins, but view hasn't been added to the view hierarchy yet - layout will fail pre iOS 11")
110110
}
111111
return superview.layoutMarginsGuide
112112

113113
case .safeArea:
114-
// constraing a view to safeArea means constraining it to it's superview's safeAreaLayoutGuide
114+
// constraining a view to safeArea means constraining it to it's superview's safeAreaLayoutGuide
115115
if #available(iOS 11.0, *), #available(tvOS 11.0, *) {
116116
return superview.safeAreaLayoutGuide
117117
}

Tests/WWLayoutTests/SizeClassTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ class SizeClassTests: XCTestCase {
185185
XCTAssertAllEqual(compactConstraints.map { $0.isActive }, true)
186186
}
187187

188+
#if compiler(>=5.3)
189+
private func XCTAssertAllEqual<T: Equatable>(_ a: [T],
190+
_ expected: T,
191+
_ message: @autoclosure () -> String = "",
192+
file: StaticString = #filePath,
193+
line: UInt = #line) {
194+
for value in a {
195+
XCTAssertEqual(value, expected, message(), file: file, line: line)
196+
}
197+
}
198+
#else
188199
private func XCTAssertAllEqual<T: Equatable>(_ a: [T],
189200
_ expected: T,
190201
_ message: @autoclosure () -> String = "",
@@ -194,6 +205,7 @@ class SizeClassTests: XCTestCase {
194205
XCTAssertEqual(value, expected, message(), file: file, line: line)
195206
}
196207
}
208+
#endif
197209

198210
private func override(horizontal: UIUserInterfaceSizeClass, vertical: UIUserInterfaceSizeClass) {
199211
let previous = controller.traitCollection

WWLayout.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
isa = PBXProject;
235235
attributes = {
236236
LastSwiftUpdateCheck = 0910;
237-
LastUpgradeCheck = 0930;
237+
LastUpgradeCheck = 1200;
238238
ORGANIZATIONNAME = "WW International, Inc.";
239239
TargetAttributes = {
240240
798F251F1FD18FA4006E6A44 = {
@@ -388,6 +388,7 @@
388388
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
389389
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
390390
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
391+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
391392
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
392393
CLANG_WARN_STRICT_PROTOTYPES = YES;
393394
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -451,6 +452,7 @@
451452
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
452453
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
453454
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
455+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
454456
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
455457
CLANG_WARN_STRICT_PROTOTYPES = YES;
456458
CLANG_WARN_SUSPICIOUS_MOVE = YES;

WWLayout.xcodeproj/xcshareddata/xcschemes/WWLayout.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

WWLayoutExample/WWLayoutExample.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
isa = PBXProject;
166166
attributes = {
167167
LastSwiftUpdateCheck = 0910;
168-
LastUpgradeCheck = 0930;
168+
LastUpgradeCheck = 1200;
169169
ORGANIZATIONNAME = "WW International, Inc.";
170170
TargetAttributes = {
171171
798F25501FD190AB006E6A44 = {
@@ -308,6 +308,7 @@
308308
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
309309
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
310310
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
311+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
311312
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
312313
CLANG_WARN_STRICT_PROTOTYPES = YES;
313314
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -367,6 +368,7 @@
367368
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
368369
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
369370
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
371+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
370372
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
371373
CLANG_WARN_STRICT_PROTOTYPES = YES;
372374
CLANG_WARN_SUSPICIOUS_MOVE = YES;

WWLayoutExample/WWLayoutExample.xcodeproj/xcshareddata/xcschemes/WWLayoutExample.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)