Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 10 support #644

Merged
merged 7 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.*

Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 4 additions & 4 deletions ReactiveSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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 = (
Expand All @@ -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 = (
Expand Down Expand Up @@ -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 = (
Expand Down
24 changes: 12 additions & 12 deletions Sources/ValidatingProperty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,47 +177,47 @@ public final class ValidatingProperty<Value, ValidationError: Swift.Error>: 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.
///
/// - note: `inner` is retained by the created property.
///
/// - parameters:
/// - inner: The inner property which validated values are committed to.
/// - initial: The initial value of the property. It is not required to
/// pass the validation as specified by `validator`.
/// - other: The property that `validator` depends on.
/// - validator: The closure to invoke for any proposed value to `self`.
public convenience init<U, E>(
_ inner: MutableProperty<Value>,
_ initial: Value,
with other: ValidatingProperty<U, E>,
_ validator: @escaping (Value, U) -> Decision
) {
self.init(inner, with: other, validator)
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.
///
/// - parameters:
/// - initial: The initial value of the property. It is not required to
/// pass the validation as specified by `validator`.
/// - 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<U, E>(
_ initial: Value,
_ inner: MutableProperty<Value>,
with other: ValidatingProperty<U, E>,
_ 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 {
Expand Down
4 changes: 2 additions & 2 deletions Tests/ReactiveSwiftTests/SignalProducerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ class SignalProducerSpec: QuickSpec {
let producer = SignalProducer<Int, NoError>.never
.on(disposed: { disposed = true })

var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1))
var replayedProducer = Optional(producer.replayLazily(upTo: 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we were using it as a regular optional anyway? Huh.


expect(disposed) == false
let disposable1 = replayedProducer?.start()
Expand All @@ -2814,7 +2814,7 @@ class SignalProducerSpec: QuickSpec {
let producer = SignalProducer<Int, NoError>.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()
Expand Down