Skip to content

Commit 4a80683

Browse files
ikesyoandersio
authored andcommitted
Xcode 10 support (#644)
* Swift 4.2: ImplicitlyUnwrappedOptional is gone * Avoid infinite recursion on a `ValidatingProperty.init` overload * Update CHANGELOG * Update Nimble to 7.1.2 for Xcode 10 compatibility * Move the "Headers" phase before the "Compile Sources" phase * Swap the implementation of two `ValidatingProperty` initialiser overloads. * Swap also the docs of the two overloads.
1 parent 2215d9a commit 4a80683

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# master
22

3+
1. Support Swift 4.2 (Xcode 10) (#644, kudos to @ikesyo)
34

45
# 4.0.0-rc.1*Please add new entries at the top.*
56

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "jspahrsummers/xcconfigs" == 0.12
22
github "Quick/Quick" ~> 1.2
3-
github "Quick/Nimble" ~> 7.0.3
3+
github "Quick/Nimble" ~> 7.1.2

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github "Quick/Nimble" "v7.1.1"
1+
github "Quick/Nimble" "v7.1.2"
22
github "Quick/Quick" "v1.3.0"
33
github "antitypical/Result" "4.0.0"
44
github "jspahrsummers/xcconfigs" "0.12"

ReactiveSwift.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@
636636
isa = PBXNativeTarget;
637637
buildConfigurationList = 57A4D23C1BA13D7A00F7D4B1 /* Build configuration list for PBXNativeTarget "ReactiveSwift-tvOS" */;
638638
buildPhases = (
639+
57A4D2091BA13D7A00F7D4B1 /* Headers */,
639640
57A4D1B01BA13D7A00F7D4B1 /* Sources */,
640641
57A4D2071BA13D7A00F7D4B1 /* Frameworks */,
641-
57A4D2091BA13D7A00F7D4B1 /* Headers */,
642642
57A4D23B1BA13D7A00F7D4B1 /* Resources */,
643643
);
644644
buildRules = (
@@ -673,9 +673,9 @@
673673
isa = PBXNativeTarget;
674674
buildConfigurationList = A9B3155D1B3940610001CB9C /* Build configuration list for PBXNativeTarget "ReactiveSwift-watchOS" */;
675675
buildPhases = (
676+
A9B315511B3940610001CB9C /* Headers */,
676677
A9B3154F1B3940610001CB9C /* Sources */,
677678
A9B315501B3940610001CB9C /* Frameworks */,
678-
A9B315511B3940610001CB9C /* Headers */,
679679
A9B315521B3940610001CB9C /* Resources */,
680680
);
681681
buildRules = (
@@ -691,9 +691,9 @@
691691
isa = PBXNativeTarget;
692692
buildConfigurationList = D047260019E49ED7006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-macOS" */;
693693
buildPhases = (
694+
D04725E719E49ED7006002AA /* Headers */,
694695
D04725E519E49ED7006002AA /* Sources */,
695696
D04725E619E49ED7006002AA /* Frameworks */,
696-
D04725E719E49ED7006002AA /* Headers */,
697697
D04725E819E49ED7006002AA /* Resources */,
698698
);
699699
buildRules = (
@@ -727,9 +727,9 @@
727727
isa = PBXNativeTarget;
728728
buildConfigurationList = D047261F19E49F82006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-iOS" */;
729729
buildPhases = (
730+
D047260919E49F82006002AA /* Headers */,
730731
D047260719E49F82006002AA /* Sources */,
731732
D047260819E49F82006002AA /* Frameworks */,
732-
D047260919E49F82006002AA /* Headers */,
733733
D047260A19E49F82006002AA /* Resources */,
734734
);
735735
buildRules = (

Sources/ValidatingProperty.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,47 +177,47 @@ public final class ValidatingProperty<Value, ValidationError: Swift.Error>: Muta
177177
) {
178178
self.init(MutableProperty(initial), with: other, validator)
179179
}
180-
181-
/// Create a `ValidatingProperty` that presents a mutable validating
182-
/// view for an inner mutable property.
180+
181+
/// Create a `ValidatingProperty` which validates mutations before
182+
/// committing them.
183183
///
184184
/// The proposed value is only committed when `valid` is returned by the
185185
/// `validator` closure.
186186
///
187187
/// - note: `inner` is retained by the created property.
188188
///
189189
/// - parameters:
190-
/// - inner: The inner property which validated values are committed to.
190+
/// - initial: The initial value of the property. It is not required to
191+
/// pass the validation as specified by `validator`.
191192
/// - other: The property that `validator` depends on.
192193
/// - validator: The closure to invoke for any proposed value to `self`.
193194
public convenience init<U, E>(
194-
_ inner: MutableProperty<Value>,
195+
_ initial: Value,
195196
with other: ValidatingProperty<U, E>,
196197
_ validator: @escaping (Value, U) -> Decision
197198
) {
198-
self.init(inner, with: other, validator)
199+
self.init(MutableProperty(initial), with: other, validator)
199200
}
200201

201-
/// Create a `ValidatingProperty` that validates mutations before
202-
/// committing them.
202+
/// Create a `ValidatingProperty` that presents a mutable validating
203+
/// view for an inner mutable property.
203204
///
204205
/// The proposed value is only committed when `valid` is returned by the
205206
/// `validator` closure.
206207
///
207208
/// - parameters:
208-
/// - initial: The initial value of the property. It is not required to
209-
/// pass the validation as specified by `validator`.
209+
/// - inner: The inner property which validated values are committed to.
210210
/// - other: The property that `validator` depends on.
211211
/// - validator: The closure to invoke for any proposed value to `self`.
212212
public convenience init<U, E>(
213-
_ initial: Value,
213+
_ inner: MutableProperty<Value>,
214214
with other: ValidatingProperty<U, E>,
215215
_ validator: @escaping (Value, U) -> Decision
216216
) {
217217
// Capture only `other.result` but not `other`.
218218
let otherValidations = other.result
219219

220-
self.init(initial) { input in
220+
self.init(inner) { input in
221221
let otherValue: U
222222

223223
switch otherValidations.value {

Tests/ReactiveSwiftTests/SignalProducerSpec.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ class SignalProducerSpec: QuickSpec {
27912791
let producer = SignalProducer<Int, NoError>.never
27922792
.on(disposed: { disposed = true })
27932793

2794-
var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1))
2794+
var replayedProducer = Optional(producer.replayLazily(upTo: 1))
27952795

27962796
expect(disposed) == false
27972797
let disposable1 = replayedProducer?.start()
@@ -2814,7 +2814,7 @@ class SignalProducerSpec: QuickSpec {
28142814
let producer = SignalProducer<Int, NoError>.never
28152815
.on(disposed: { disposed = true })
28162816

2817-
var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1))
2817+
var replayedProducer = Optional(producer.replayLazily(upTo: 1))
28182818

28192819
expect(disposed) == false
28202820
let disposable = replayedProducer?.start()

0 commit comments

Comments
 (0)