From e1638422cd486d0c6b1bf332be1d83c4ad104bf9 Mon Sep 17 00:00:00 2001 From: Benjamin Maer Date: Wed, 14 Oct 2020 15:38:22 -0400 Subject: [PATCH 1/9] Changed retain policy on base to unowned on dismissed event. --- RxFlow/Extensions/Reactive+UIViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxFlow/Extensions/Reactive+UIViewController.swift b/RxFlow/Extensions/Reactive+UIViewController.swift index 1e2ac70..3a0ec7e 100644 --- a/RxFlow/Extensions/Reactive+UIViewController.swift +++ b/RxFlow/Extensions/Reactive+UIViewController.swift @@ -17,7 +17,7 @@ public extension Reactive where Base: UIViewController { /// Rx observable, triggered when the view is being dismissed var dismissed: ControlEvent { let dismissedSource = self.sentMessage(#selector(Base.viewDidDisappear)) - .filter { [base] _ in base.isBeingDismissed } + .filter { [unowned base] _ in base.isBeingDismissed } .map { _ in false } let movedToParentSource = self.sentMessage(#selector(Base.didMove)) From 33c040d4e88e33e0ade57eb32bcf59def9303e7b Mon Sep 17 00:00:00 2001 From: Benjamin Maer Date: Mon, 19 Oct 2020 13:07:12 -0400 Subject: [PATCH 2/9] Switch from unowned to weak to avoid potential crash, and use default value true if base somehow dies by the time this closure is hit. --- RxFlow/Extensions/Reactive+UIViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxFlow/Extensions/Reactive+UIViewController.swift b/RxFlow/Extensions/Reactive+UIViewController.swift index 3a0ec7e..7ec27e1 100644 --- a/RxFlow/Extensions/Reactive+UIViewController.swift +++ b/RxFlow/Extensions/Reactive+UIViewController.swift @@ -17,7 +17,7 @@ public extension Reactive where Base: UIViewController { /// Rx observable, triggered when the view is being dismissed var dismissed: ControlEvent { let dismissedSource = self.sentMessage(#selector(Base.viewDidDisappear)) - .filter { [unowned base] _ in base.isBeingDismissed } + .filter { [weak base] _ in base.isBeingDismissed ?? true } .map { _ in false } let movedToParentSource = self.sentMessage(#selector(Base.didMove)) From 7743f52330f6c9e13c70794ce59e67e5d1637686 Mon Sep 17 00:00:00 2001 From: Benjamin Maer Date: Mon, 19 Oct 2020 13:11:43 -0400 Subject: [PATCH 3/9] Fixed --- RxFlow/Extensions/Reactive+UIViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxFlow/Extensions/Reactive+UIViewController.swift b/RxFlow/Extensions/Reactive+UIViewController.swift index 7ec27e1..bd29077 100644 --- a/RxFlow/Extensions/Reactive+UIViewController.swift +++ b/RxFlow/Extensions/Reactive+UIViewController.swift @@ -17,7 +17,7 @@ public extension Reactive where Base: UIViewController { /// Rx observable, triggered when the view is being dismissed var dismissed: ControlEvent { let dismissedSource = self.sentMessage(#selector(Base.viewDidDisappear)) - .filter { [weak base] _ in base.isBeingDismissed ?? true } + .filter { [weak base] _ in base?.isBeingDismissed ?? true } .map { _ in false } let movedToParentSource = self.sentMessage(#selector(Base.didMove)) From d950933a4a3da61d762b2eeb9d64db2a6a43f08e Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 12:45:18 -0500 Subject: [PATCH 4/9] project: bump to rxswift 6.0.0 --- .swiftlint.yml | 13 +------------ Cartfile | 2 +- Cartfile.resolved | 2 +- Package.swift | 2 +- RxFlow.podspec | 6 +++--- RxFlow.xcodeproj/project.pbxproj | 2 ++ RxFlow/FlowCoordinator.swift | 6 +++--- RxFlowDemo/Cartfile | 2 +- RxFlowDemo/Cartfile.resolved | 2 +- .../Wishlist/WishlistViewController.swift | 2 +- .../SettingsApiKeyViewController.swift | 2 +- .../Settings/SettingsListViewController.swift | 4 ++-- .../SettingsLoginViewController.swift | 2 +- RxFlowDemo/xcarthage.sh | 19 +++++++++++++++++++ RxFlowTests/Flow+PresentableTests.swift | 4 ++-- .../ObservableType+PausableTests.swift | 4 ++-- RxFlowTests/StepperTests.swift | 12 ++++++------ .../UIViewController+PresentableTests.swift | 4 ++-- xcarthage.sh | 2 +- 19 files changed, 51 insertions(+), 41 deletions(-) create mode 100755 RxFlowDemo/xcarthage.sh diff --git a/.swiftlint.yml b/.swiftlint.yml index 0beb04d..ed934b6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,13 +1,10 @@ included: - RxFlow -excluded: - - Carthage - - Pods analyzer_rules: disabled_rules: - large_tuple - unused_declaration - - file_header + - unused_import opt_in_rules: - anyobject_protocol - array_init @@ -25,7 +22,6 @@ opt_in_rules: - explicit_init - extension_access_modifier - fallthrough - - file_header - first_where - flatmap_over_map_reduce - identical_operands @@ -83,10 +79,3 @@ identifier_name: - id number_separator: minimum_length: 5 -file_name: - excluded: - - main.swift - - LinuxMain.swift - - TestHelpers.swift - - shim.swift - - AutomaticRuleTests.generated.swift diff --git a/Cartfile b/Cartfile index ee48bc1..b974c62 100755 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveX/RxSwift" ~> 5.1.1 +github "ReactiveX/RxSwift" ~> 6.0.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index ec14f25..c07923a 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "ReactiveX/RxSwift" "5.1.1" +github "ReactiveX/RxSwift" "6.0.0" diff --git a/Package.swift b/Package.swift index 1242272..79eef50 100644 --- a/Package.swift +++ b/Package.swift @@ -9,7 +9,7 @@ let package = Package( .library(name: "RxFlow", targets: ["RxFlow"]), ], dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.1.1")), + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.0.0")), ], targets: [ .target( diff --git a/RxFlow.podspec b/RxFlow.podspec index 18fd660..74042ad 100644 --- a/RxFlow.podspec +++ b/RxFlow.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxFlow" - s.version = "2.11.0" + s.version = "2.12.0" s.swift_version = '5.3' s.summary = "RxFlow is a navigation framework for iOS applications, based on a Reactive Coordinator pattern." @@ -27,6 +27,6 @@ RxFlow aims to s.source_files = "RxFlow/**/*.swift" s.frameworks = "UIKit" s.requires_arc = true - s.dependency "RxSwift", ">= 5.1.1" - s.dependency "RxCocoa", ">= 5.1.1" + s.dependency "RxSwift", ">= 6.0.0" + s.dependency "RxCocoa", ">= 6.0.0" end diff --git a/RxFlow.xcodeproj/project.pbxproj b/RxFlow.xcodeproj/project.pbxproj index d76aa4c..ee989a6 100644 --- a/RxFlow.xcodeproj/project.pbxproj +++ b/RxFlow.xcodeproj/project.pbxproj @@ -505,6 +505,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.2; + VALIDATE_WORKSPACE = NO; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -562,6 +563,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; + VALIDATE_WORKSPACE = NO; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/RxFlow/FlowCoordinator.swift b/RxFlow/FlowCoordinator.swift index 0f750ee..d00b55f 100644 --- a/RxFlow/FlowCoordinator.swift +++ b/RxFlow/FlowCoordinator.swift @@ -46,7 +46,7 @@ public final class FlowCoordinator: NSObject { // listen for the internal steps relay that aggregates the flow's Stepper's steps and // the FlowContributors's Stepper's steps self.stepsRelay - .takeUntil(allowStepWhenDismissed ? .empty() : flow.rxDismissed.asObservable()) + .take(until: allowStepWhenDismissed ? .empty() : flow.rxDismissed.asObservable()) .do(onDispose: { [weak self] in self?.childFlowCoordinators.removeAll() self?.parentFlowCoordinator?.childFlowCoordinators.removeValue(forKey: self?.identifier ?? "") @@ -106,7 +106,7 @@ public final class FlowCoordinator: NSObject { .do(onSubscribed: { stepper.readyToEmitSteps() }) .startWith(stepper.initialStep) .filter { !($0 is NoneStep) } - .takeUntil(allowStepWhenDismissed ? .empty() : flow.rxDismissed.asObservable()) + .take(until: allowStepWhenDismissed ? .empty() : flow.rxDismissed.asObservable()) // for now commenting this line to allow a Stepper trigger "dismissing" steps // even if a flow is displayed on top of it // .pausable(afterCount: 1, withPauser: flow.rxVisible) @@ -177,7 +177,7 @@ public final class FlowCoordinator: NSObject { .do(onSubscribed: { nextPresentableAndStepper.stepper.readyToEmitSteps() }) .startWith(nextPresentableAndStepper.stepper.initialStep) .filter { !($0 is NoneStep) } - .takeUntil(allowStepWhenDismissed ? .empty() : nextPresentableAndStepper.presentable.rxDismissed.asObservable()) + .take(until: allowStepWhenDismissed ? .empty() : nextPresentableAndStepper.presentable.rxDismissed.asObservable()) // by default we cannot accept steps from a presentable that is not visible if nextPresentableAndStepper.allowStepWhenNotPresented == false { diff --git a/RxFlowDemo/Cartfile b/RxFlowDemo/Cartfile index c33e4e8..12fbf30 100755 --- a/RxFlowDemo/Cartfile +++ b/RxFlowDemo/Cartfile @@ -1,2 +1,2 @@ -github "ReactiveX/RxSwift" ~> 5.1.1 +github "ReactiveX/RxSwift" ~> 6.0.0 github "AliSoftware/Reusable" ~> 4.0.5 diff --git a/RxFlowDemo/Cartfile.resolved b/RxFlowDemo/Cartfile.resolved index 97f300a..47486e6 100644 --- a/RxFlowDemo/Cartfile.resolved +++ b/RxFlowDemo/Cartfile.resolved @@ -1,2 +1,2 @@ github "AliSoftware/Reusable" "4.1.1" -github "ReactiveX/RxSwift" "5.1.1" +github "ReactiveX/RxSwift" "6.0.0" diff --git a/RxFlowDemo/RxFlowDemo/Features/Dashboard/Wishlist/WishlistViewController.swift b/RxFlowDemo/RxFlowDemo/Features/Dashboard/Wishlist/WishlistViewController.swift index 257c428..25702c2 100644 --- a/RxFlowDemo/RxFlowDemo/Features/Dashboard/Wishlist/WishlistViewController.swift +++ b/RxFlowDemo/RxFlowDemo/Features/Dashboard/Wishlist/WishlistViewController.swift @@ -27,7 +27,7 @@ class WishlistViewController: UIViewController, StoryboardBased, ViewModelBased _ = Observable .interval(.seconds(5), scheduler: MainScheduler.instance) - .takeUntil(self.rx.deallocating) + .take(until: self.rx.deallocating) .map { _ in return DemoStep.fakeStep } .bind(to: self.steps) } diff --git a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsApiKeyViewController.swift b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsApiKeyViewController.swift index 7ca94c4..e689ff5 100644 --- a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsApiKeyViewController.swift +++ b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsApiKeyViewController.swift @@ -23,7 +23,7 @@ class SettingsApiKeyViewController: UIViewController, StoryboardBased, ViewModel // Do any additional setup after loading the view. _ = proceedButton.rx.tap - .takeUntil(self.rx.deallocating) + .take(until: self.rx.deallocating) .subscribe(onNext: { [unowned self] _ in self.viewModel.setApiKey() }) diff --git a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsListViewController.swift b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsListViewController.swift index ad1fda3..861a772 100644 --- a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsListViewController.swift +++ b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsListViewController.swift @@ -31,13 +31,13 @@ class SettingsListViewController: UITableViewController, StoryboardBased, Steppe super.viewDidLoad() _ = Observable.of(settings) - .takeUntil(self.rx.deallocating) + .take(until: self.rx.deallocating) .bind(to: tableView.rx.items(cellIdentifier: "SettingCell")) { _, element, cell in cell.textLabel?.text = element.title } _ = tableView.rx.modelSelected(SettingItem.self) - .takeUntil(self.rx.deallocating) + .take(until: self.rx.deallocating) .map { $0.step } .bind(to: self.steps) } diff --git a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsLoginViewController.swift b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsLoginViewController.swift index d1f369f..fdd9406 100644 --- a/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsLoginViewController.swift +++ b/RxFlowDemo/RxFlowDemo/Features/Settings/SettingsLoginViewController.swift @@ -23,7 +23,7 @@ class SettingsLoginViewController: UIViewController, StoryboardBased, Stepper { // Do any additional setup after loading the view. _ = proceedButton.rx.tap - .takeUntil(self.rx.deallocating) + .take(until: self.rx.deallocating) .map { DemoStep.userIsLoggedIn } .bind(to: self.steps) } diff --git a/RxFlowDemo/xcarthage.sh b/RxFlowDemo/xcarthage.sh new file mode 100755 index 0000000..4b58ddb --- /dev/null +++ b/RxFlowDemo/xcarthage.sh @@ -0,0 +1,19 @@ +# carthage-build.sh +# Usage example: ./carthage-build.sh --platform iOS + +set -euo pipefail + +xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) +trap 'rm -f "$xcconfig"' INT TERM HUP EXIT + +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. + +CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) +echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig + +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +carthage update "$@" diff --git a/RxFlowTests/Flow+PresentableTests.swift b/RxFlowTests/Flow+PresentableTests.swift index 91ef610..9fa4c7a 100644 --- a/RxFlowTests/Flow+PresentableTests.swift +++ b/RxFlowTests/Flow+PresentableTests.swift @@ -34,7 +34,7 @@ final class Flow_PresentableTests: XCTestCase { let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Bool.self) testScheduler.start() - _ = testFlow.rxVisible.asObservable().takeUntil(self.rx.deallocating).bind(to: observer) + _ = testFlow.rxVisible.asObservable().take(until: self.rx.deallocating).bind(to: observer) // When: Displaying/Hiding it 3 times testFlow.rootViewController.viewDidAppear(false) @@ -60,7 +60,7 @@ final class Flow_PresentableTests: XCTestCase { let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Void.self) testScheduler.start() - _ = testFlow.rxDismissed.asObservable().takeUntil(self.rx.deallocating).bind(to: observer) + _ = testFlow.rxDismissed.asObservable().take(until: self.rx.deallocating).bind(to: observer) // When: Dismissing the Flow testFlow.rootViewController.didMove(toParent: nil) diff --git a/RxFlowTests/ObservableType+PausableTests.swift b/RxFlowTests/ObservableType+PausableTests.swift index d5ae799..7a84748 100644 --- a/RxFlowTests/ObservableType+PausableTests.swift +++ b/RxFlowTests/ObservableType+PausableTests.swift @@ -19,7 +19,7 @@ final class ObservableType_PausableTests: XCTestCase { // When: executing the sequence let values = try emitter - .takeUntil(self.rx.deallocated) + .take(until: self.rx.deallocated) .do(onNext: { (value) in pauserSubject.onNext((value % 2) == 0) }) @@ -37,7 +37,7 @@ final class ObservableType_PausableTests: XCTestCase { // When: executing the sequence let values = try emitter - .takeUntil(self.rx.deallocated) + .take(until: self.rx.deallocated) .do(onNext: { (value) in pauserSubject.onNext((value % 2) == 0) }) diff --git a/RxFlowTests/StepperTests.swift b/RxFlowTests/StepperTests.swift index 237241e..f1d8de5 100644 --- a/RxFlowTests/StepperTests.swift +++ b/RxFlowTests/StepperTests.swift @@ -60,7 +60,7 @@ final class StepperTests: XCTestCase { let stepperClass = StepperClass(with: StepperTestsStep.stepOne, andNextStep: StepperTestsStep.stepTwo) let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = stepperClass.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = stepperClass.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: emitting a new step @@ -78,7 +78,7 @@ final class StepperTests: XCTestCase { let stepperClass = OneStepper(withSingleStep: StepperTestsStep.stepOne) let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = stepperClass.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = stepperClass.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: emitting the initial step @@ -94,7 +94,7 @@ final class StepperTests: XCTestCase { let stepperClass = NoneStepper() let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = stepperClass.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = stepperClass.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: emitting the initial step @@ -113,7 +113,7 @@ final class StepperTests: XCTestCase { let compositeStepper = CompositeStepper(steppers: stepsToEmit.map { OneStepper(withSingleStep: $0) }) let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = compositeStepper.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = compositeStepper.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: launching the steps sequence @@ -151,7 +151,7 @@ final class StepperTests: XCTestCase { let compositeStepper = CompositeStepper(steppers: stepperClasses) let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = compositeStepper.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = compositeStepper.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: launching the steps sequence @@ -178,7 +178,7 @@ final class StepperTests: XCTestCase { let compositeStepper = CustomCompositeStepper(with: StepperTestsStep.stepReference, andSteppers: stepperClasses) let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Step.self) - _ = compositeStepper.steps.takeUntil(self.rx.deallocating).bind(to: observer) + _ = compositeStepper.steps.take(until: self.rx.deallocating).bind(to: observer) testScheduler.start() // When: launching the steps sequence diff --git a/RxFlowTests/UIViewController+PresentableTests.swift b/RxFlowTests/UIViewController+PresentableTests.swift index e858ab4..09fe617 100644 --- a/RxFlowTests/UIViewController+PresentableTests.swift +++ b/RxFlowTests/UIViewController+PresentableTests.swift @@ -22,7 +22,7 @@ final class UIViewController_PresentableTests: XCTestCase { let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Bool.self) testScheduler.start() - _ = viewController.rxVisible.asObservable().takeUntil(self.rx.deallocating).bind(to: observer) + _ = viewController.rxVisible.asObservable().take(until: self.rx.deallocating).bind(to: observer) // When: Displaying/Hiding it 3 times viewController.viewDidAppear(false) @@ -48,7 +48,7 @@ final class UIViewController_PresentableTests: XCTestCase { let testScheduler = TestScheduler(initialClock: 0) let observer = testScheduler.createObserver(Void.self) testScheduler.start() - _ = viewController.rxDismissed.asObservable().takeUntil(self.rx.deallocating).bind(to: observer) + _ = viewController.rxDismissed.asObservable().take(until: self.rx.deallocating).bind(to: observer) // When: Dismissing the ViewController viewController.didMove(toParent: nil) diff --git a/xcarthage.sh b/xcarthage.sh index f3bc14e..4b58ddb 100755 --- a/xcarthage.sh +++ b/xcarthage.sh @@ -16,4 +16,4 @@ echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x8 echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig export XCODE_XCCONFIG_FILE="$xcconfig" -carthage build "$@" +carthage update "$@" From 714dff919fea21ce2a4f99c0f53fb4ee4b9e442a Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 12:48:06 -0500 Subject: [PATCH 5/9] project: update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b738623..342e8d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +** Version 2.12.0 **: + +- bump to RxSwift 6.0.0 + ** Version 2.10 **: - remove Reusable as a private dependency From 80f7c58906390c5fd776dfc603d0a1954869d5f2 Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 12:57:28 -0500 Subject: [PATCH 6/9] project: update CI to run xcarthage-bootstrap.sh --- .github/workflows/ci.yml | 2 +- xcarthage-bootstrap.sh | 19 +++++++++++++++++++ xcarthage.sh => xcarthage-update.sh | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 xcarthage-bootstrap.sh rename xcarthage.sh => xcarthage-update.sh (93%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61be83c..7816df1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@master - name: Compile and Test run: | - carthage bootstrap --platform iOS --cache-builds && xcodebuild clean test -project RxFlow.xcodeproj -scheme RxFlow -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO + ./xcarthage-bootstrap.sh --platform iOS --cache-builds && xcodebuild clean test -project RxFlow.xcodeproj -scheme RxFlow -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO env: destination: ${{ matrix.destination }} diff --git a/xcarthage-bootstrap.sh b/xcarthage-bootstrap.sh new file mode 100755 index 0000000..ead4b07 --- /dev/null +++ b/xcarthage-bootstrap.sh @@ -0,0 +1,19 @@ +# carthage-bootstrap.sh +# Usage example: ./carthage-bootstrap.sh --platform iOS + +set -euo pipefail + +xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) +trap 'rm -f "$xcconfig"' INT TERM HUP EXIT + +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. + +CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) +echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig + +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +carthage bootstrap "$@" diff --git a/xcarthage.sh b/xcarthage-update.sh similarity index 93% rename from xcarthage.sh rename to xcarthage-update.sh index 4b58ddb..e1f7660 100755 --- a/xcarthage.sh +++ b/xcarthage-update.sh @@ -1,5 +1,5 @@ -# carthage-build.sh -# Usage example: ./carthage-build.sh --platform iOS +# carthage-update.sh +# Usage example: ./carthage-update.sh --platform iOS set -euo pipefail From d19fd2c952d3af2f493b286fbfd3996104331609 Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 13:10:20 -0500 Subject: [PATCH 7/9] project: bump CI destination --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7816df1..7a8ebcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,8 @@ jobs: runs-on: macos-latest strategy: matrix: - destination: ['platform=iOS Simulator,OS=13.0,name=iPhone 11 Pro'] - swift-version: ['5.1'] + destination: ['platform=iOS Simulator,OS=14.0,name=iPhone 11 Pro'] + swift-version: ['5.3'] steps: - name: Install Swift uses: YOCKOW/Action-setup-swift@master From 8e52ab7130cf4eb691f30a2acdc07c112483224d Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 15:09:22 -0500 Subject: [PATCH 8/9] project: exclude arm64 arch from sim sdk in build settings --- RxFlow.xcodeproj/project.pbxproj | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/RxFlow.xcodeproj/project.pbxproj b/RxFlow.xcodeproj/project.pbxproj index ee989a6..6c7a5e1 100644 --- a/RxFlow.xcodeproj/project.pbxproj +++ b/RxFlow.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -32,11 +32,11 @@ 74855A492470552B00334B8F /* DeprecatedFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74855A482470552B00334B8F /* DeprecatedFlowCoordinator.swift */; }; 749B02E822066518001BEBBB /* RxBlocking.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 749B02E722066518001BEBBB /* RxBlocking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 749B02EC22066538001BEBBB /* RxTest.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 749B02EA22066538001BEBBB /* RxTest.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 749B02EF22066618001BEBBB /* RxCocoa.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 749B02ED22066618001BEBBB /* RxCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 749B02EF22066618001BEBBB /* RxCocoa.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 749B02ED22066618001BEBBB /* RxCocoa.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 749B02F022066618001BEBBB /* RxSwift.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 749B02EE22066618001BEBBB /* RxSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 749B02F12206665A001BEBBB /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 749B02ED22066618001BEBBB /* RxCocoa.framework */; }; 749B02F22206665A001BEBBB /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 749B02EE22066618001BEBBB /* RxSwift.framework */; }; - 749B02F322066675001BEBBB /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 749B02ED22066618001BEBBB /* RxCocoa.framework */; }; + 749B02F322066675001BEBBB /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 749B02ED22066618001BEBBB /* RxCocoa.framework */; platformFilter = ios; }; 749B02F422066675001BEBBB /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 749B02EE22066618001BEBBB /* RxSwift.framework */; }; 749B02F82206852D001BEBBB /* Flow+PresentableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749B02F72206852D001BEBBB /* Flow+PresentableTests.swift */; }; 749B02FC220688EC001BEBBB /* FlowCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749B02FB220688EC001BEBBB /* FlowCoordinatorTests.swift */; }; @@ -417,7 +417,11 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = RxFlowTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlowTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -437,7 +441,11 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = RxFlowTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlowTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -484,6 +492,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -549,6 +558,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -560,7 +570,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; VALIDATE_WORKSPACE = NO; @@ -588,7 +599,11 @@ INFOPLIST_FILE = RxFlow/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 2.11.0; PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlow; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -619,7 +634,11 @@ INFOPLIST_FILE = RxFlow/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 2.11.0; PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlow; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; From 752be3fa641f8e8e30c598185febb1ac7627682d Mon Sep 17 00:00:00 2001 From: Thibault Wittemberg Date: Sat, 2 Jan 2021 15:26:27 -0500 Subject: [PATCH 9/9] project: add an item in v2.12.0 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 342e8d0..dc3214f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ** Version 2.12.0 **: - bump to RxSwift 6.0.0 +- change retain policy in Reactive+UIViewController.swift ** Version 2.10 **: