Skip to content

Commit

Permalink
Merge pull request #166 from RxSwiftCommunity/release/2.12.0
Browse files Browse the repository at this point in the history
Release/2.12.0
  • Loading branch information
twittemb authored Jan 2, 2021
2 parents ccf32fd + 752be3f commit b0883bc
Show file tree
Hide file tree
Showing 23 changed files with 106 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

13 changes: 1 addition & 12 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,7 +22,6 @@ opt_in_rules:
- explicit_init
- extension_access_modifier
- fallthrough
- file_header
- first_where
- flatmap_over_map_reduce
- identical_operands
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
** Version 2.12.0 **:

- bump to RxSwift 6.0.0
- change retain policy in Reactive+UIViewController.swift

** Version 2.10 **:

- remove Reusable as a private dependency
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 5.1.1
github "ReactiveX/RxSwift" ~> 6.0.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" "5.1.1"
github "ReactiveX/RxSwift" "6.0.0"
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions RxFlow.podspec
Original file line number Diff line number Diff line change
@@ -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."

Expand All @@ -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
37 changes: 29 additions & 8 deletions RxFlow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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 = "";
Expand All @@ -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 = "";
Expand Down Expand Up @@ -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;
Expand All @@ -505,6 +514,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
VALIDATE_WORKSPACE = NO;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -548,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;
Expand All @@ -559,9 +570,11 @@
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;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -586,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)";
Expand Down Expand Up @@ -617,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)";
Expand Down
2 changes: 1 addition & 1 deletion RxFlow/Extensions/Reactive+UIViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension Reactive where Base: UIViewController {
/// Rx observable, triggered when the view is being dismissed
var dismissed: ControlEvent<Bool> {
let dismissedSource = self.sentMessage(#selector(Base.viewDidDisappear))
.filter { [base] _ in base.isBeingDismissed }
.filter { [weak base] _ in base?.isBeingDismissed ?? true }
.map { _ in false }

let movedToParentSource = self.sentMessage(#selector(Base.didMove))
Expand Down
6 changes: 3 additions & 3 deletions RxFlow/FlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion RxFlowDemo/Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "ReactiveX/RxSwift" ~> 5.1.1
github "ReactiveX/RxSwift" ~> 6.0.0
github "AliSoftware/Reusable" ~> 4.0.5
2 changes: 1 addition & 1 deletion RxFlowDemo/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/Reusable" "4.1.1"
github "ReactiveX/RxSwift" "5.1.1"
github "ReactiveX/RxSwift" "6.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WishlistViewController: UIViewController, StoryboardBased, ViewModelBased

_ = Observable<Int>
.interval(.seconds(5), scheduler: MainScheduler.instance)
.takeUntil(self.rx.deallocating)
.take(until: self.rx.deallocating)
.map { _ in return DemoStep.fakeStep }
.bind(to: self.steps)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion xcarthage.sh → RxFlowDemo/xcarthage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
4 changes: 2 additions & 2 deletions RxFlowTests/Flow+PresentableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions RxFlowTests/ObservableType+PausableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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)
})
Expand Down
12 changes: 6 additions & 6 deletions RxFlowTests/StepperTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit b0883bc

Please sign in to comment.