diff --git a/.gitmodules b/.gitmodules index b1bee2b9..50cd9927 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "Carthage/Checkouts/Result"] path = Carthage/Checkouts/Result - url = ssh://git@github.com/antitypical/Result.git + url = https://github.com/antitypical/Result.git [submodule "Carthage/Checkouts/ReactiveCocoa"] path = Carthage/Checkouts/ReactiveCocoa - url = ssh://git@github.com/ReactiveCocoa/ReactiveCocoa.git + url = https://github.com/ReactiveCocoa/ReactiveCocoa.git [submodule "Carthage/Checkouts/ReactiveSwift"] path = Carthage/Checkouts/ReactiveSwift - url = ssh://git@github.com/ReactiveCocoa/ReactiveSwift.git + url = https://github.com/ReactiveCocoa/ReactiveSwift.git diff --git a/Cartfile b/Cartfile index feaf04f7..64188a36 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveCocoa/ReactiveCocoa" +github "ReactiveCocoa/ReactiveCocoa" ~> 7.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 486e9cca..eb999591 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "ReactiveCocoa/ReactiveCocoa" "6.0.1" -github "ReactiveCocoa/ReactiveSwift" "2.0.1" -github "antitypical/Result" "3.2.3" +github "ReactiveCocoa/ReactiveCocoa" "7.0.0" +github "ReactiveCocoa/ReactiveSwift" "3.0.0" +github "antitypical/Result" "3.2.4" diff --git a/Carthage/Checkouts/ReactiveCocoa b/Carthage/Checkouts/ReactiveCocoa index afe5b34d..22aa25cc 160000 --- a/Carthage/Checkouts/ReactiveCocoa +++ b/Carthage/Checkouts/ReactiveCocoa @@ -1 +1 @@ -Subproject commit afe5b34d384a86fec79766672b965de56005ba42 +Subproject commit 22aa25cc2c7a9f94c802f5ba7722542fc88b05d8 diff --git a/Carthage/Checkouts/ReactiveSwift b/Carthage/Checkouts/ReactiveSwift index b9d5b350..2ec944c4 160000 --- a/Carthage/Checkouts/ReactiveSwift +++ b/Carthage/Checkouts/ReactiveSwift @@ -1 +1 @@ -Subproject commit b9d5b350a446b85704396ce332a1f9e4960cfc6b +Subproject commit 2ec944c43ef9cf6b1380629e3ea483f62a7afaef diff --git a/Carthage/Checkouts/Result b/Carthage/Checkouts/Result index c8446185..74775842 160000 --- a/Carthage/Checkouts/Result +++ b/Carthage/Checkouts/Result @@ -1 +1 @@ -Subproject commit c8446185238659a2b27c0261f64ff1254291d07d +Subproject commit 7477584259bfce2560a19e06ad9f71db441fff11 diff --git a/FueledUtils/DecoratingTextFieldDelegate.swift b/FueledUtils/DecoratingTextFieldDelegate.swift index 33d03a45..741e6ccc 100644 --- a/FueledUtils/DecoratingTextFieldDelegate.swift +++ b/FueledUtils/DecoratingTextFieldDelegate.swift @@ -64,16 +64,15 @@ public final class DecoratingTextFieldDelegate: NSObject { /// `patternForDataString`. public func decorateString(_ dataString: String) -> String { var res = "" - let dataChars = dataString.characters - var dataIndex = dataChars.startIndex + var dataIndex = dataString.startIndex let pattern = self.patternForDataString(dataString) - for patternChar in pattern.characters { + for patternChar in pattern { if patternChar == patternPlaceholderForDataCharacter { - if dataIndex == dataChars.endIndex { + if dataIndex == dataString.endIndex { return res } - res += String(dataChars[dataIndex]) - dataIndex = dataChars.index(after: dataIndex) + res += String(dataString[dataIndex]) + dataIndex = dataString.index(after: dataIndex) } else { res += String(patternChar) } @@ -84,7 +83,7 @@ public final class DecoratingTextFieldDelegate: NSObject { /// Strips formatting (decoration) characters from the input string. public func undecorateString(_ decoratedString: String) -> String { var res = "" - for decoChar in decoratedString.characters { + for decoChar in decoratedString { if isDataCharacter(decoChar) { res += String(decoChar) } @@ -106,7 +105,7 @@ public final class DecoratingTextFieldDelegate: NSObject { } var res = 0 var prefixLength = dataLocation - for decoChar in decoratedString.characters { + for decoChar in decoratedString { let characterLength = String(decoChar).nsLength if isDataCharacter(decoChar) { if prefixLength <= 0 { diff --git a/FueledUtils/RACExtensions.swift b/FueledUtils/RACExtensions.swift index c6990e81..70e0d54c 100644 --- a/FueledUtils/RACExtensions.swift +++ b/FueledUtils/RACExtensions.swift @@ -56,13 +56,13 @@ public extension SignalProtocol { will result in all changes to `constraintConstantValue` in `viewModel` to be reflected in the constraint and animated. */ public func observe(context: @escaping (@escaping () -> Void) -> Void) -> Signal { - return Signal { observer in - return self.signal.observe { event in + return Signal { observer, disposable in + disposable += self.signal.observe { event in switch event { case .value: - context({ observer.action(event) }) + context({ observer.send(event) }) default: - observer.action(event) + observer.send(event) } } } @@ -109,14 +109,13 @@ public extension SignalProtocol { /// `interval` seconds apart. /// func minimum(interval: TimeInterval, on scheduler: DateScheduler) -> Signal { - return Signal { observer in + return Signal { observer, disposable in let semaphore = DispatchSemaphore(value: 1) var events: [Signal.Event] = [] var forwardEvents = false - let disposable = CompositeDisposable() func sendEvents() { semaphore.wait() - events.forEach { observer.action($0) } + events.forEach { observer.send($0) } events.removeAll() forwardEvents = true semaphore.signal() @@ -127,18 +126,17 @@ public extension SignalProtocol { disposable += self.signal.observe { event in if case .interrupted = event { sendEvents() - observer.action(event) + observer.send(event) return } if forwardEvents { - observer.action(event) + observer.send(event) } else { semaphore.wait() events.append(event) semaphore.signal() } } - return disposable } } } diff --git a/FueledUtils/SetRootViewController.swift b/FueledUtils/SetRootViewController.swift index 98c8a1a2..d38da109 100644 --- a/FueledUtils/SetRootViewController.swift +++ b/FueledUtils/SetRootViewController.swift @@ -12,6 +12,7 @@ public extension UIApplicationDelegate { animations: { UIView.setAnimationsEnabled(false) window.endEditing(true) + window.rootViewController = viewController window.layoutIfNeeded() UIView.setAnimationsEnabled(true) diff --git a/FueledUtils/SignalingAlert.swift b/FueledUtils/SignalingAlert.swift index 9cf0f8c2..f59e6799 100644 --- a/FueledUtils/SignalingAlert.swift +++ b/FueledUtils/SignalingAlert.swift @@ -21,7 +21,7 @@ public final class SignalingAlert { public func addAction(title: String, style: UIAlertActionStyle, event: Signal.Event) { controller.addAction(UIAlertAction(title: title, style: style) { [observer] _ in - observer.action(event) + observer.send(event) }) }