From c893f4fdb314c45b9e570fd0a22000b350514732 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Wed, 6 Jun 2018 14:34:50 -0700 Subject: [PATCH 1/7] Swift 4.2: ImplicitlyUnwrappedOptional is gone --- Tests/ReactiveSwiftTests/SignalProducerSpec.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/ReactiveSwiftTests/SignalProducerSpec.swift b/Tests/ReactiveSwiftTests/SignalProducerSpec.swift index 90f01e310..96450af9a 100644 --- a/Tests/ReactiveSwiftTests/SignalProducerSpec.swift +++ b/Tests/ReactiveSwiftTests/SignalProducerSpec.swift @@ -2791,7 +2791,7 @@ class SignalProducerSpec: QuickSpec { let producer = SignalProducer.never .on(disposed: { disposed = true }) - var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1)) + var replayedProducer = Optional(producer.replayLazily(upTo: 1)) expect(disposed) == false let disposable1 = replayedProducer?.start() @@ -2814,7 +2814,7 @@ class SignalProducerSpec: QuickSpec { let producer = SignalProducer.never .on(disposed: { disposed = true }) - var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1)) + var replayedProducer = Optional(producer.replayLazily(upTo: 1)) expect(disposed) == false let disposable = replayedProducer?.start() From e27310de692416a4fd70edfd1896ff3245ca4b51 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Wed, 6 Jun 2018 14:37:06 -0700 Subject: [PATCH 2/7] Avoid infinite recursion on a `ValidatingProperty.init` overload --- Sources/ValidatingProperty.swift | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Sources/ValidatingProperty.swift b/Sources/ValidatingProperty.swift index 086d15f06..94dad51fd 100644 --- a/Sources/ValidatingProperty.swift +++ b/Sources/ValidatingProperty.swift @@ -178,26 +178,6 @@ public final class ValidatingProperty: Muta self.init(MutableProperty(initial), with: other, validator) } - /// Create a `ValidatingProperty` that presents a mutable validating - /// view for an inner mutable property. - /// - /// The proposed value is only committed when `valid` is returned by the - /// `validator` closure. - /// - /// - note: `inner` is retained by the created property. - /// - /// - parameters: - /// - inner: The inner property which validated values are committed to. - /// - other: The property that `validator` depends on. - /// - validator: The closure to invoke for any proposed value to `self`. - public convenience init( - _ inner: MutableProperty, - with other: ValidatingProperty, - _ validator: @escaping (Value, U) -> Decision - ) { - self.init(inner, with: other, validator) - } - /// Create a `ValidatingProperty` that validates mutations before /// committing them. /// From 70b32990aeb23009d8efd76502040537f05289e7 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Wed, 6 Jun 2018 16:12:30 -0700 Subject: [PATCH 3/7] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1409e689f..ac8849cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # master +1. Support Swift 4.2 (Xcode 10) (#644, kudos to @ikesyo) # 4.0.0-rc.1*Please add new entries at the top.* From 9d397462bb650bab4c81559973c4784b986c3309 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Wed, 6 Jun 2018 16:51:12 -0700 Subject: [PATCH 4/7] Update Nimble to 7.1.2 for Xcode 10 compatibility --- Cartfile.private | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/Nimble | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cartfile.private b/Cartfile.private index 0cafaf21e..c1b339e35 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,3 +1,3 @@ github "jspahrsummers/xcconfigs" == 0.12 github "Quick/Quick" ~> 1.2 -github "Quick/Nimble" ~> 7.0.3 +github "Quick/Nimble" ~> 7.1.2 diff --git a/Cartfile.resolved b/Cartfile.resolved index 226d99680..dcb87e962 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,4 +1,4 @@ -github "Quick/Nimble" "v7.1.1" +github "Quick/Nimble" "v7.1.2" github "Quick/Quick" "v1.3.0" github "antitypical/Result" "4.0.0" github "jspahrsummers/xcconfigs" "0.12" diff --git a/Carthage/Checkouts/Nimble b/Carthage/Checkouts/Nimble index 21f4fed20..8023e3980 160000 --- a/Carthage/Checkouts/Nimble +++ b/Carthage/Checkouts/Nimble @@ -1 +1 @@ -Subproject commit 21f4fed2052cea480f5f1d2044d45aa25fdfb988 +Subproject commit 8023e3980d91b470ad073d6da843b73f2eeb1844 From eb2bae11e044bea36348321cd2be484b4eca17c5 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Sat, 9 Jun 2018 08:44:22 -0700 Subject: [PATCH 5/7] Move the "Headers" phase before the "Compile Sources" phase --- ReactiveSwift.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactiveSwift.xcodeproj/project.pbxproj b/ReactiveSwift.xcodeproj/project.pbxproj index 961bd2f97..597a6ec37 100644 --- a/ReactiveSwift.xcodeproj/project.pbxproj +++ b/ReactiveSwift.xcodeproj/project.pbxproj @@ -636,9 +636,9 @@ isa = PBXNativeTarget; buildConfigurationList = 57A4D23C1BA13D7A00F7D4B1 /* Build configuration list for PBXNativeTarget "ReactiveSwift-tvOS" */; buildPhases = ( + 57A4D2091BA13D7A00F7D4B1 /* Headers */, 57A4D1B01BA13D7A00F7D4B1 /* Sources */, 57A4D2071BA13D7A00F7D4B1 /* Frameworks */, - 57A4D2091BA13D7A00F7D4B1 /* Headers */, 57A4D23B1BA13D7A00F7D4B1 /* Resources */, ); buildRules = ( @@ -673,9 +673,9 @@ isa = PBXNativeTarget; buildConfigurationList = A9B3155D1B3940610001CB9C /* Build configuration list for PBXNativeTarget "ReactiveSwift-watchOS" */; buildPhases = ( + A9B315511B3940610001CB9C /* Headers */, A9B3154F1B3940610001CB9C /* Sources */, A9B315501B3940610001CB9C /* Frameworks */, - A9B315511B3940610001CB9C /* Headers */, A9B315521B3940610001CB9C /* Resources */, ); buildRules = ( @@ -691,9 +691,9 @@ isa = PBXNativeTarget; buildConfigurationList = D047260019E49ED7006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-macOS" */; buildPhases = ( + D04725E719E49ED7006002AA /* Headers */, D04725E519E49ED7006002AA /* Sources */, D04725E619E49ED7006002AA /* Frameworks */, - D04725E719E49ED7006002AA /* Headers */, D04725E819E49ED7006002AA /* Resources */, ); buildRules = ( @@ -727,9 +727,9 @@ isa = PBXNativeTarget; buildConfigurationList = D047261F19E49F82006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-iOS" */; buildPhases = ( + D047260919E49F82006002AA /* Headers */, D047260719E49F82006002AA /* Sources */, D047260819E49F82006002AA /* Frameworks */, - D047260919E49F82006002AA /* Headers */, D047260A19E49F82006002AA /* Resources */, ); buildRules = ( From 794bcd600a777035679f80f2db1368da4352cd88 Mon Sep 17 00:00:00 2001 From: Anders Ha Date: Mon, 11 Jun 2018 17:39:01 +0100 Subject: [PATCH 6/7] Swap the implementation of two `ValidatingProperty` initialiser overloads. --- Sources/ValidatingProperty.swift | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Sources/ValidatingProperty.swift b/Sources/ValidatingProperty.swift index 94dad51fd..9dc19f2d1 100644 --- a/Sources/ValidatingProperty.swift +++ b/Sources/ValidatingProperty.swift @@ -177,13 +177,15 @@ public final class ValidatingProperty: Muta ) { self.init(MutableProperty(initial), with: other, validator) } - - /// Create a `ValidatingProperty` that validates mutations before - /// committing them. + + /// Create a `ValidatingProperty` that presents a mutable validating + /// view for an inner mutable property. /// /// The proposed value is only committed when `valid` is returned by the /// `validator` closure. /// + /// - note: `inner` is retained by the created property. + /// /// - parameters: /// - initial: The initial value of the property. It is not required to /// pass the validation as specified by `validator`. @@ -193,11 +195,29 @@ public final class ValidatingProperty: Muta _ initial: Value, with other: ValidatingProperty, _ validator: @escaping (Value, U) -> Decision + ) { + self.init(MutableProperty(initial), with: other, validator) + } + + /// Create a `ValidatingProperty` that validates mutations before + /// committing them. + /// + /// The proposed value is only committed when `valid` is returned by the + /// `validator` closure. + /// + /// - parameters: + /// - inner: The inner property which validated values are committed to. + /// - other: The property that `validator` depends on. + /// - validator: The closure to invoke for any proposed value to `self`. + public convenience init( + _ inner: MutableProperty, + with other: ValidatingProperty, + _ validator: @escaping (Value, U) -> Decision ) { // Capture only `other.result` but not `other`. let otherValidations = other.result - self.init(initial) { input in + self.init(inner) { input in let otherValue: U switch otherValidations.value { From e78bcf67c69e879bf880ea5d1f14f246cd661b0b Mon Sep 17 00:00:00 2001 From: Anders Ha Date: Mon, 11 Jun 2018 17:40:16 +0100 Subject: [PATCH 7/7] Swap also the docs of the two overloads. --- Sources/ValidatingProperty.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/ValidatingProperty.swift b/Sources/ValidatingProperty.swift index 9dc19f2d1..7cebd437e 100644 --- a/Sources/ValidatingProperty.swift +++ b/Sources/ValidatingProperty.swift @@ -178,8 +178,8 @@ public final class ValidatingProperty: Muta self.init(MutableProperty(initial), with: other, validator) } - /// Create a `ValidatingProperty` that presents a mutable validating - /// view for an inner mutable property. + /// Create a `ValidatingProperty` which validates mutations before + /// committing them. /// /// The proposed value is only committed when `valid` is returned by the /// `validator` closure. @@ -199,8 +199,8 @@ public final class ValidatingProperty: Muta self.init(MutableProperty(initial), with: other, validator) } - /// Create a `ValidatingProperty` that validates mutations before - /// committing them. + /// Create a `ValidatingProperty` that presents a mutable validating + /// view for an inner mutable property. /// /// The proposed value is only committed when `valid` is returned by the /// `validator` closure.