From aacfcc894bd3bc3ea1b03d483720973ea0e02905 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sun, 1 Oct 2017 16:06:47 +0200 Subject: [PATCH] Release 4.0.0-beta.1 --- CHANGELOG.md | 18 ++++ RxBlocking.podspec | 4 +- RxCocoa.podspec | 4 +- .../RxCollectionViewDataSourceProxy.swift | 10 +- .../RxCollectionViewDelegateProxy.swift | 8 +- .../RxNavigationControllerDelegateProxy.swift | 10 +- .../Proxies/RxPickerViewDataSourceProxy.swift | 10 +- .../Proxies/RxPickerViewDelegateProxy.swift | 10 +- .../Proxies/RxScrollViewDelegateProxy.swift | 16 +-- .../Proxies/RxSearchBarDelegateProxy.swift | 10 +- .../RxSearchControllerDelegateProxy.swift | 10 +- .../RxTabBarControllerDelegateProxy.swift | 10 +- .../iOS/Proxies/RxTabBarDelegateProxy.swift | 10 +- .../Proxies/RxTableViewDataSourceProxy.swift | 10 +- .../Proxies/RxTableViewDelegateProxy.swift | 8 +- .../Proxies/RxTextStorageDelegateProxy.swift | 10 +- .../iOS/Proxies/RxTextViewDelegateProxy.swift | 8 +- .../iOS/Proxies/RxWebViewDelegateProxy.swift | 10 +- RxCocoa/macOS/NSTextField+Rx.swift | 10 +- .../RxCLLocationManagerDelegateProxy.swift | 6 +- .../RxImagePickerDelegateProxy.swift | 4 +- .../RxExample-iOSUITests/FlowTests.swift | 6 +- RxExample/RxExample.xcodeproj/project.pbxproj | 6 +- .../APIWrappers/APIWrappers.storyboard | 9 +- .../Calculator/CalculatorViewController.swift | 2 +- .../GithubSignupViewModel1.swift | 10 +- .../SimpleValidationViewController.swift | 6 +- ...iewWithEditingCommandsViewController.swift | 2 +- .../ViewModels/SearchResultViewModel.swift | 2 +- RxExample/RxExample/Info-iOS.plist | 4 +- RxExample/RxExample/iOS/AppDelegate.swift | 2 +- RxSwift.podspec | 2 +- RxTest.podspec | 4 +- .../DelegateProxyTest+Cocoa.swift | 6 +- .../DelegateProxyTest+UIKit.swift | 100 +++++++++--------- 35 files changed, 192 insertions(+), 165 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 757103580..3eba19f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,24 @@ All notable changes to this project will be documented in this file. * Call `controlTextDidChange(…)` as an optional method. #1406 * Fixed issue with `NSControl.rx.value` regarding multiple observers. #1399 +## [4.0.0-beta.1](https://github.com/ReactiveX/RxSwift/releases/tag/4.0.0-beta.1) + +* Adds `attributedText` to `UITextField`. #1249 +* Adds `attributedText` to `UITextView`. #1249 +* Deprecates `shareReplayLatestWhileConnected` and `shareReplay` in favor of `share(replay:scope:)`. #1430 +* Changes `publish`, `replay`, `replayAll` to clear state in case of sequence termination to be more consistent with other Rx implementations and enable retries. #1430 +* Replaces `share` with default implementation of `share(replay:scope:)`. #1430 +* Adds `HasDelegate` and `HasDataSource` protocols. +* Updates package version to v4 format. #1418 + +#### Anomalies + +* Adds deprecated warnings to API parts that were missing it. #1427 +* Improves memory handling in `isScheduleRequiredKey`. #1428 +* Removes pre-release identifier from bundle version to enable `TestFlight` submissions. #1424 +* Removes code coverage to enable `TestFlight` submissions. #1423 +* Fixes Xcode warnings. #1421 + ## [4.0.0-beta.0](https://github.com/ReactiveX/RxSwift/releases/tag/4.0.0-beta.0) * Adds `materialize()` operator for RxBlocking's `BlockingObservable`. #1383 diff --git a/RxBlocking.podspec b/RxBlocking.podspec index 40e28b207..6a50ee526 100644 --- a/RxBlocking.podspec +++ b/RxBlocking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxBlocking" - s.version = "4.0.0-beta.0" + s.version = "4.0.0-beta.1" s.summary = "RxSwift Blocking operatos" s.description = <<-DESC Set of blocking operators for RxSwift. These operators are mostly intended for unit/integration tests @@ -25,5 +25,5 @@ Waiting for observable sequence to complete before exiting command line applicat s.source_files = 'RxBlocking/**/*.swift', 'Platform/**/*.swift' s.exclude_files = 'RxBlocking/Platform/**/*.swift' - s.dependency 'RxSwift', '~> 4.0.0-beta.0' + s.dependency 'RxSwift', '~> 4.0.0-beta.1' end diff --git a/RxCocoa.podspec b/RxCocoa.podspec index 73526e1e6..22f037145 100644 --- a/RxCocoa.podspec +++ b/RxCocoa.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxCocoa" - s.version = "4.0.0-beta.0" + s.version = "4.0.0-beta.1" s.summary = "RxSwift Cocoa extensions" s.description = <<-DESC * UI extensions @@ -27,5 +27,5 @@ Pod::Spec.new do |s| s.watchos.source_files = 'RxCocoa/iOS/**/*.swift' s.tvos.source_files = 'RxCocoa/iOS/**/*.swift' - s.dependency 'RxSwift', '~> 4.0.0-beta.0' + s.dependency 'RxSwift', '~> 4.0.0-beta.1' end diff --git a/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift b/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift index 2c88e6696..82b42fe0f 100644 --- a/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift +++ b/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift @@ -44,15 +44,15 @@ open class RxCollectionViewDataSourceProxy /// Typed parent object. public weak private(set) var collectionView: UICollectionView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.collectionView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxCollectionViewDataSourceProxy.self) + /// - parameter collectionView: Parent object for delegate proxy. + public init(collectionView: ParentObject) { + self.collectionView = collectionView + super.init(parentObject: collectionView, delegateProxy: RxCollectionViewDataSourceProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxCollectionViewDataSourceProxy(parentObject: $0) } + self.register { RxCollectionViewDataSourceProxy(collectionView: $0) } } private weak var _requiredMethodsDataSource: UICollectionViewDataSource? = collectionViewDataSourceNotSet diff --git a/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift index b9435850d..4fd82f1d3 100644 --- a/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift @@ -24,10 +24,10 @@ open class RxCollectionViewDelegateProxy /// Initializes `RxCollectionViewDelegateProxy` /// - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: UICollectionView) { - self.collectionView = parentObject - super.init(parentObject: parentObject) + /// - parameter collectionView: Parent object for delegate proxy. + public init(collectionView: UICollectionView) { + self.collectionView = collectionView + super.init(scrollView: collectionView) } } diff --git a/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift index b059ee6ff..59940e0d2 100644 --- a/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift @@ -26,15 +26,15 @@ /// Typed parent object. public weak private(set) var navigationController: UINavigationController? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.navigationController = parentObject - super.init(parentObject: parentObject, delegateProxy: RxNavigationControllerDelegateProxy.self) + /// - parameter navigationController: Parent object for delegate proxy. + public init(navigationController: ParentObject) { + self.navigationController = navigationController + super.init(parentObject: navigationController, delegateProxy: RxNavigationControllerDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxNavigationControllerDelegateProxy(parentObject: $0) } + self.register { RxNavigationControllerDelegateProxy(navigationController: $0) } } } #endif diff --git a/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift b/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift index 130aaaf87..745a1846c 100644 --- a/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift +++ b/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift @@ -38,15 +38,15 @@ public class RxPickerViewDataSourceProxy /// Typed parent object. public weak private(set) var pickerView: UIPickerView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.pickerView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxPickerViewDataSourceProxy.self) + /// - parameter pickerView: Parent object for delegate proxy. + public init(pickerView: ParentObject) { + self.pickerView = pickerView + super.init(parentObject: pickerView, delegateProxy: RxPickerViewDataSourceProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxPickerViewDataSourceProxy(parentObject: $0) } + self.register { RxPickerViewDataSourceProxy(pickerView: $0) } } private weak var _requiredMethodsDataSource: UIPickerViewDataSource? = pickerViewDataSourceNotSet diff --git a/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift index 192a23505..0252db138 100644 --- a/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift @@ -25,15 +25,15 @@ /// Typed parent object. public weak private(set) var pickerView: UIPickerView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.pickerView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxPickerViewDelegateProxy.self) + /// - parameter pickerView: Parent object for delegate proxy. + public init(pickerView: ParentObject) { + self.pickerView = pickerView + super.init(parentObject: pickerView, delegateProxy: RxPickerViewDelegateProxy.self) } // Register known implementationss public static func registerKnownImplementations() { - self.register { RxPickerViewDelegateProxy(parentObject: $0) } + self.register { RxPickerViewDelegateProxy(pickerView: $0) } } } #endif diff --git a/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift index 82c8b9ae9..f59111497 100644 --- a/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift @@ -26,18 +26,18 @@ open class RxScrollViewDelegateProxy /// Typed parent object. public weak private(set) var scrollView: UIScrollView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.scrollView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxScrollViewDelegateProxy.self) + /// - parameter scrollView: Parent object for delegate proxy. + public init(scrollView: ParentObject) { + self.scrollView = scrollView + super.init(parentObject: scrollView, delegateProxy: RxScrollViewDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxScrollViewDelegateProxy(parentObject: $0) } - self.register { RxTableViewDelegateProxy(parentObject: $0) } - self.register { RxCollectionViewDelegateProxy(parentObject: $0) } - self.register { RxTextViewDelegateProxy(parentObject: $0) } + self.register { RxScrollViewDelegateProxy(scrollView: $0) } + self.register { RxTableViewDelegateProxy(tableView: $0) } + self.register { RxCollectionViewDelegateProxy(collectionView: $0) } + self.register { RxTextViewDelegateProxy(textView: $0) } } fileprivate var _contentOffsetBehaviorSubject: BehaviorSubject? diff --git a/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift index 290b13e2c..1c0c7f95a 100644 --- a/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift @@ -26,15 +26,15 @@ open class RxSearchBarDelegateProxy /// Typed parent object. public weak private(set) var searchBar: UISearchBar? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.searchBar = parentObject - super.init(parentObject: parentObject, delegateProxy: RxSearchBarDelegateProxy.self) + /// - parameter searchBar: Parent object for delegate proxy. + public init(searchBar: ParentObject) { + self.searchBar = searchBar + super.init(parentObject: searchBar, delegateProxy: RxSearchBarDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxSearchBarDelegateProxy(parentObject: $0) } + self.register { RxSearchBarDelegateProxy(searchBar: $0) } } } diff --git a/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift index ba8b9e437..0cb258810 100644 --- a/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift @@ -27,15 +27,15 @@ open class RxSearchControllerDelegateProxy /// Typed parent object. public weak private(set) var searchController: UISearchController? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.searchController = parentObject - super.init(parentObject: parentObject, delegateProxy: RxSearchControllerDelegateProxy.self) + /// - parameter searchController: Parent object for delegate proxy. + public init(searchController: UISearchController) { + self.searchController = searchController + super.init(parentObject: searchController, delegateProxy: RxSearchControllerDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxSearchControllerDelegateProxy(parentObject: $0) } + self.register { RxSearchControllerDelegateProxy(searchController: $0) } } } diff --git a/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift index 473eb60c0..232ab6a8b 100644 --- a/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift @@ -26,15 +26,15 @@ open class RxTabBarControllerDelegateProxy /// Typed parent object. public weak private(set) var tabBar: UITabBarController? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.tabBar = parentObject - super.init(parentObject: parentObject, delegateProxy: RxTabBarControllerDelegateProxy.self) + /// - parameter tabBar: Parent object for delegate proxy. + public init(tabBar: ParentObject) { + self.tabBar = tabBar + super.init(parentObject: tabBar, delegateProxy: RxTabBarControllerDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxTabBarControllerDelegateProxy(parentObject: $0) } + self.register { RxTabBarControllerDelegateProxy(tabBar: $0) } } } diff --git a/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift index 2713a7c98..2b0593e0c 100644 --- a/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift @@ -26,15 +26,15 @@ open class RxTabBarDelegateProxy /// Typed parent object. public weak private(set) var tabBar: UITabBar? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.tabBar = parentObject - super.init(parentObject: parentObject, delegateProxy: RxTabBarDelegateProxy.self) + /// - parameter tabBar: Parent object for delegate proxy. + public init(tabBar: ParentObject) { + self.tabBar = tabBar + super.init(parentObject: tabBar, delegateProxy: RxTabBarDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxTabBarDelegateProxy(parentObject: $0) } + self.register { RxTabBarDelegateProxy(tabBar: $0) } } /// For more information take a look at `DelegateProxyType`. diff --git a/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift b/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift index 94bf3b6d4..144d8c637 100644 --- a/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift @@ -41,15 +41,15 @@ open class RxTableViewDataSourceProxy /// Typed parent object. public weak private(set) var tableView: UITableView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: UITableView) { - self.tableView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxTableViewDataSourceProxy.self) + /// - parameter tableView: Parent object for delegate proxy. + public init(tableView: UITableView) { + self.tableView = tableView + super.init(parentObject: tableView, delegateProxy: RxTableViewDataSourceProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxTableViewDataSourceProxy(parentObject: $0) } + self.register { RxTableViewDataSourceProxy(tableView: $0) } } fileprivate weak var _requiredMethodsDataSource: UITableViewDataSource? = tableViewDataSourceNotSet diff --git a/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift index 615944637..d32a4a2fe 100644 --- a/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift @@ -21,10 +21,10 @@ open class RxTableViewDelegateProxy /// Typed parent object. public weak private(set) var tableView: UITableView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: UITableView) { - self.tableView = parentObject - super.init(parentObject: parentObject) + /// - parameter tableView: Parent object for delegate proxy. + public init(tableView: UITableView) { + self.tableView = tableView + super.init(scrollView: tableView) } } diff --git a/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift index 86620b804..63194eea6 100644 --- a/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift @@ -25,15 +25,15 @@ /// Typed parent object. public weak private(set) var textStorage: NSTextStorage? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: NSTextStorage) { - self.textStorage = parentObject - super.init(parentObject: parentObject, delegateProxy: RxTextStorageDelegateProxy.self) + /// - parameter textStorage: Parent object for delegate proxy. + public init(textStorage: NSTextStorage) { + self.textStorage = textStorage + super.init(parentObject: textStorage, delegateProxy: RxTextStorageDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxTextStorageDelegateProxy(parentObject: $0) } + self.register { RxTextStorageDelegateProxy(textStorage: $0) } } } #endif diff --git a/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift index 1f4698b90..42f2d2362 100644 --- a/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift @@ -21,10 +21,10 @@ open class RxTextViewDelegateProxy /// Typed parent object. public weak private(set) var textView: UITextView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: UITextView) { - self.textView = parentObject - super.init(parentObject: parentObject) + /// - parameter textview: Parent object for delegate proxy. + public init(textView: UITextView) { + self.textView = textView + super.init(scrollView: textView) } // MARK: delegate methods diff --git a/RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift index 3c630c49d..df410119b 100644 --- a/RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift @@ -25,15 +25,15 @@ open class RxWebViewDelegateProxy /// Typed parent object. public weak private(set) var webView: UIWebView? - /// - parameter parentObject: Parent object for delegate proxy. - public init(parentObject: ParentObject) { - self.webView = parentObject - super.init(parentObject: parentObject, delegateProxy: RxWebViewDelegateProxy.self) + /// - parameter webView: Parent object for delegate proxy. + public init(webView: ParentObject) { + self.webView = webView + super.init(parentObject: webView, delegateProxy: RxWebViewDelegateProxy.self) } // Register known implementations public static func registerKnownImplementations() { - self.register { RxWebViewDelegateProxy(parentObject: $0) } + self.register { RxWebViewDelegateProxy(webView: $0) } } } diff --git a/RxCocoa/macOS/NSTextField+Rx.swift b/RxCocoa/macOS/NSTextField+Rx.swift index b6b2e31b9..d173e1799 100644 --- a/RxCocoa/macOS/NSTextField+Rx.swift +++ b/RxCocoa/macOS/NSTextField+Rx.swift @@ -26,14 +26,14 @@ open class RxTextFieldDelegateProxy /// Initializes `RxTextFieldDelegateProxy` /// - /// - parameter parentObject: Parent object for delegate proxy. - init(parentObject: NSTextField) { - self.textField = parentObject - super.init(parentObject: parentObject, delegateProxy: RxTextFieldDelegateProxy.self) + /// - parameter textField: Parent object for delegate proxy. + init(textField: NSTextField) { + self.textField = textField + super.init(parentObject: textField, delegateProxy: RxTextFieldDelegateProxy.self) } public static func registerKnownImplementations() { - self.register { RxTextFieldDelegateProxy(parentObject: $0) } + self.register { RxTextFieldDelegateProxy(textField: $0) } } fileprivate let textSubject = PublishSubject() diff --git a/RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift b/RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift index 87f11997f..a4d695fc3 100644 --- a/RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift +++ b/RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift @@ -21,12 +21,12 @@ public class RxCLLocationManagerDelegateProxy , DelegateProxyType , CLLocationManagerDelegate { - public init(parentObject: CLLocationManager) { - super.init(parentObject: parentObject, delegateProxy: RxCLLocationManagerDelegateProxy.self) + public init(locationManager: CLLocationManager) { + super.init(parentObject: locationManager, delegateProxy: RxCLLocationManagerDelegateProxy.self) } public static func registerKnownImplementations() { - self.register { RxCLLocationManagerDelegateProxy(parentObject: $0) } + self.register { RxCLLocationManagerDelegateProxy(locationManager: $0) } } internal lazy var didUpdateLocationsSubject = PublishSubject<[CLLocation]>() diff --git a/RxExample/Extensions/RxImagePickerDelegateProxy.swift b/RxExample/Extensions/RxImagePickerDelegateProxy.swift index 1846907b0..ea6aa49ce 100644 --- a/RxExample/Extensions/RxImagePickerDelegateProxy.swift +++ b/RxExample/Extensions/RxImagePickerDelegateProxy.swift @@ -17,8 +17,8 @@ open class RxImagePickerDelegateProxy : RxNavigationControllerDelegateProxy, UIImagePickerControllerDelegate { - public init(parentObject: UIImagePickerController) { - super.init(parentObject: parentObject) + public init(imagePicker: UIImagePickerController) { + super.init(navigationController: imagePicker) } } diff --git a/RxExample/RxExample-iOSUITests/FlowTests.swift b/RxExample/RxExample-iOSUITests/FlowTests.swift index 4ae6193cb..f4bab70e7 100644 --- a/RxExample/RxExample-iOSUITests/FlowTests.swift +++ b/RxExample/RxExample-iOSUITests/FlowTests.swift @@ -125,13 +125,13 @@ extension FlowTests { extension FlowTests { func testControls() { for test in [ + _testUITextView, + _testUITextField, _testDatePicker, _testBarButtonItemTap, _testButtonTap, _testSegmentedControl, _testUISwitch, - _testUITextField, - _testUITextView, _testSlider ] { goToControlsView() @@ -211,6 +211,8 @@ extension FlowTests { textView.tap() textView.typeText("f") checkDebugLabelValue("UITextView text f") + goBack() + goToControlsView() let textView2 = app.textViews.allElementsBoundByIndex[1] textView2.tap() textView2.typeText("f2") diff --git a/RxExample/RxExample.xcodeproj/project.pbxproj b/RxExample/RxExample.xcodeproj/project.pbxproj index 18ea11208..4571776a0 100644 --- a/RxExample/RxExample.xcodeproj/project.pbxproj +++ b/RxExample/RxExample.xcodeproj/project.pbxproj @@ -1852,7 +1852,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-objc_loadall"; - PRODUCT_BUNDLE_IDENTIFIER = io.rx.example; + PRODUCT_BUNDLE_IDENTIFIER = io.rx.example.4.0.0; PRODUCT_NAME = "RxExample-iOS"; SDKROOT = iphoneos; }; @@ -1867,7 +1867,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-objc_loadall"; - PRODUCT_BUNDLE_IDENTIFIER = io.rx.example; + PRODUCT_BUNDLE_IDENTIFIER = io.rx.example.4.0.0; PRODUCT_NAME = "RxExample-iOS"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -2074,7 +2074,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-objc_loadall"; - PRODUCT_BUNDLE_IDENTIFIER = io.rx.example; + PRODUCT_BUNDLE_IDENTIFIER = io.rx.example.4.0.0; PRODUCT_NAME = "RxExample-iOS"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/RxExample/RxExample/Examples/APIWrappers/APIWrappers.storyboard b/RxExample/RxExample/Examples/APIWrappers/APIWrappers.storyboard index f0962f8eb..1bbdc67de 100644 --- a/RxExample/RxExample/Examples/APIWrappers/APIWrappers.storyboard +++ b/RxExample/RxExample/Examples/APIWrappers/APIWrappers.storyboard @@ -25,7 +25,7 @@ - + @@ -127,6 +127,13 @@ + + + + + + + diff --git a/RxExample/RxExample/Examples/Calculator/CalculatorViewController.swift b/RxExample/RxExample/Examples/Calculator/CalculatorViewController.swift index 4abd3af6f..8ec962c6c 100644 --- a/RxExample/RxExample/Examples/Calculator/CalculatorViewController.swift +++ b/RxExample/RxExample/Examples/Calculator/CalculatorViewController.swift @@ -75,7 +75,7 @@ class CalculatorViewController: ViewController { feedback: { _ in commands } ) .debug("calculator state") - .shareReplayLatestWhileConnected() + .share(replay: 1) system.map { $0.screen } .bind(to: resultLabel.rx.text) diff --git a/RxExample/RxExample/Examples/GitHubSignup/UsingVanillaObservables/GithubSignupViewModel1.swift b/RxExample/RxExample/Examples/GitHubSignup/UsingVanillaObservables/GithubSignupViewModel1.swift index e07970e68..d821c9b0b 100644 --- a/RxExample/RxExample/Examples/GitHubSignup/UsingVanillaObservables/GithubSignupViewModel1.swift +++ b/RxExample/RxExample/Examples/GitHubSignup/UsingVanillaObservables/GithubSignupViewModel1.swift @@ -70,16 +70,16 @@ class GithubSignupViewModel1 { .observeOn(MainScheduler.instance) .catchErrorJustReturn(.failed(message: "Error contacting server")) } - .shareReplay(1) + .share(replay: 1) validatedPassword = input.password .map { password in return validationService.validatePassword(password) } - .shareReplay(1) + .share(replay: 1) validatedPasswordRepeated = Observable.combineLatest(input.password, input.repeatedPassword, resultSelector: validationService.validateRepeatedPassword) - .shareReplay(1) + .share(replay: 1) let signingIn = ActivityIndicator() self.signingIn = signingIn.asObservable() @@ -101,7 +101,7 @@ class GithubSignupViewModel1 { loggedIn } } - .shareReplay(1) + .share(replay: 1) signupEnabled = Observable.combineLatest( validatedUsername, @@ -115,6 +115,6 @@ class GithubSignupViewModel1 { !signingIn } .distinctUntilChanged() - .shareReplay(1) + .share(replay: 1) } } diff --git a/RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift b/RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift index 053b1242d..9cfe3242d 100644 --- a/RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift +++ b/RxExample/RxExample/Examples/SimpleValidation/SimpleValidationViewController.swift @@ -33,14 +33,14 @@ class SimpleValidationViewController : ViewController { let usernameValid = usernameOutlet.rx.text.orEmpty .map { $0.characters.count >= minimalUsernameLength } - .shareReplay(1) // without this map would be executed once for each binding, rx is stateless by default + .share(replay: 1) // without this map would be executed once for each binding, rx is stateless by default let passwordValid = passwordOutlet.rx.text.orEmpty .map { $0.characters.count >= minimalPasswordLength } - .shareReplay(1) + .share(replay: 1) let everythingValid = Observable.combineLatest(usernameValid, passwordValid) { $0 && $1 } - .shareReplay(1) + .share(replay: 1) usernameValid .bind(to: passwordOutlet.rx.isEnabled) diff --git a/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift b/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift index 2a4db76e9..494e6623f 100644 --- a/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift +++ b/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift @@ -98,7 +98,7 @@ class TableViewWithEditingCommandsViewController: ViewController, UITableViewDel accumulator: TableViewEditingCommandsViewModel.executeCommand, scheduler: MainScheduler.instance, feedback: { _ in initialLoadCommand }, { _ in deleteUserCommand }, { _ in moveUserCommand }) - .shareReplay(1) + .share(replay: 1) viewModel .map { diff --git a/RxExample/RxExample/Examples/WikipediaImageSearch/ViewModels/SearchResultViewModel.swift b/RxExample/RxExample/Examples/WikipediaImageSearch/ViewModels/SearchResultViewModel.swift index 1e5037e69..4a9f12360 100644 --- a/RxExample/RxExample/Examples/WikipediaImageSearch/ViewModels/SearchResultViewModel.swift +++ b/RxExample/RxExample/Examples/WikipediaImageSearch/ViewModels/SearchResultViewModel.swift @@ -64,6 +64,6 @@ class SearchResultViewModel { return [] } } - .shareReplayLatestWhileConnected() + .share(replay: 1) } } diff --git a/RxExample/RxExample/Info-iOS.plist b/RxExample/RxExample/Info-iOS.plist index 061288de6..ebc8c367f 100644 --- a/RxExample/RxExample/Info-iOS.plist +++ b/RxExample/RxExample/Info-iOS.plist @@ -2,8 +2,6 @@ - NSLocationWhenInUseUsageDescription - We need location CFBundleDevelopmentRegion en CFBundleExecutable @@ -33,6 +31,8 @@ We need camera NSLocationAlwaysUsageDescription We need location + NSLocationWhenInUseUsageDescription + We need location NSPhotoLibraryUsageDescription We need photo library UILaunchStoryboardName diff --git a/RxExample/RxExample/iOS/AppDelegate.swift b/RxExample/RxExample/iOS/AppDelegate.swift index 068a0c7a4..9c6e9401e 100644 --- a/RxExample/RxExample/iOS/AppDelegate.swift +++ b/RxExample/RxExample/iOS/AppDelegate.swift @@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UIView.setAnimationsEnabled(false) } - RxImagePickerDelegateProxy.register { RxImagePickerDelegateProxy(parentObject: $0) } + RxImagePickerDelegateProxy.register { RxImagePickerDelegateProxy(imagePicker: $0) } #if DEBUG _ = Observable.interval(1, scheduler: MainScheduler.instance) diff --git a/RxSwift.podspec b/RxSwift.podspec index e15575631..7878ba87d 100644 --- a/RxSwift.podspec +++ b/RxSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxSwift" - s.version = "4.0.0-beta.0" + s.version = "4.0.0-beta.1" s.summary = "RxSwift is a Swift implementation of Reactive Extensions" s.description = <<-DESC This is a Swift port of [ReactiveX.io](https://github.com/ReactiveX) diff --git a/RxTest.podspec b/RxTest.podspec index 15a7ed3e2..8fb43701d 100644 --- a/RxTest.podspec +++ b/RxTest.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxTest" - s.version = "4.0.0-beta.0" + s.version = "4.0.0-beta.1" s.summary = "RxSwift Testing extensions" s.description = <<-DESC Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers @@ -56,7 +56,7 @@ func testMap() { s.framework = 'XCTest' - s.dependency 'RxSwift', '~> 4.0.0-beta.0' + s.dependency 'RxSwift', '~> 4.0.0-beta.1' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } end diff --git a/Tests/RxCocoaTests/DelegateProxyTest+Cocoa.swift b/Tests/RxCocoaTests/DelegateProxyTest+Cocoa.swift index 872fed691..13d36f3d3 100644 --- a/Tests/RxCocoaTests/DelegateProxyTest+Cocoa.swift +++ b/Tests/RxCocoaTests/DelegateProxyTest+Cocoa.swift @@ -15,7 +15,7 @@ import XCTest extension DelegateProxyTest { func test_NSTextFieldDelegateExtension() { - performDelegateTest(NSTextFieldSubclass(frame: CGRect.zero)) { ExtendNSTextFieldDelegateProxy(parentObject: $0) } + performDelegateTest(NSTextFieldSubclass(frame: CGRect.zero)) { ExtendNSTextFieldDelegateProxy(textFieldSubclass: $0) } } } @@ -24,8 +24,8 @@ extension DelegateProxyTest { class ExtendNSTextFieldDelegateProxy : RxTextFieldDelegateProxy , TestDelegateProtocol { - override init(parentObject: ParentObject) { - super.init(parentObject: parentObject) + init(textFieldSubclass: NSTextFieldSubclass) { + super.init(textField: textFieldSubclass) } } diff --git a/Tests/RxCocoaTests/DelegateProxyTest+UIKit.swift b/Tests/RxCocoaTests/DelegateProxyTest+UIKit.swift index 7f2fff53f..1cdc9b486 100644 --- a/Tests/RxCocoaTests/DelegateProxyTest+UIKit.swift +++ b/Tests/RxCocoaTests/DelegateProxyTest+UIKit.swift @@ -16,11 +16,11 @@ import XCTest extension DelegateProxyTest { func test_UITableViewDelegateExtension() { - performDelegateTest(UITableViewSubclass1(frame: CGRect.zero)) { ExtendTableViewDelegateProxy(parentObject: $0) } + performDelegateTest(UITableViewSubclass1(frame: CGRect.zero)) { ExtendTableViewDelegateProxy(tableViewSubclass: $0) } } func test_UITableViewDataSourceExtension() { - performDelegateTest(UITableViewSubclass2(frame: CGRect.zero)) { ExtendTableViewDataSourceProxy(parentObject: $0) } + performDelegateTest(UITableViewSubclass2(frame: CGRect.zero)) { ExtendTableViewDataSourceProxy(tableViewSubclass: $0) } } } @@ -39,44 +39,44 @@ extension DelegateProxyTest { extension DelegateProxyTest { func test_UINavigationControllerDelegateExtension() { - performDelegateTest(UINavigationControllerSubclass()) { ExtendNavigationControllerDelegateProxy(parentObject: $0) } + performDelegateTest(UINavigationControllerSubclass()) { ExtendNavigationControllerDelegateProxy(navigationControllerSubclass: $0) } } } extension DelegateProxyTest { func test_UIScrollViewDelegateExtension() { - performDelegateTest(UIScrollViewSubclass(frame: CGRect.zero)) { ExtendScrollViewDelegateProxy(parentObject: $0) } + performDelegateTest(UIScrollViewSubclass(frame: CGRect.zero)) { ExtendScrollViewDelegateProxy(scrollViewSubclass: $0) } } } #if os(iOS) extension DelegateProxyTest { func test_UISearchBarDelegateExtension() { - performDelegateTest(UISearchBarSubclass(frame: CGRect.zero)) { ExtendSearchBarDelegateProxy(parentObject: $0) } + performDelegateTest(UISearchBarSubclass(frame: CGRect.zero)) { ExtendSearchBarDelegateProxy(searchBarSubclass: $0) } } } #endif extension DelegateProxyTest { func test_UITextViewDelegateExtension() { - performDelegateTest(UITextViewSubclass(frame: CGRect.zero)) { ExtendTextViewDelegateProxy(parentObject: $0) } + performDelegateTest(UITextViewSubclass(frame: CGRect.zero)) { ExtendTextViewDelegateProxy(textViewSubclass: $0) } } } #if os(iOS) extension DelegateProxyTest { func test_UISearchController() { - performDelegateTest(UISearchControllerSubclass()) { ExtendSearchControllerDelegateProxy(parentObject: $0) } + performDelegateTest(UISearchControllerSubclass()) { ExtendSearchControllerDelegateProxy(searchControllerSubclass: $0) } } } extension DelegateProxyTest { func test_UIPickerViewExtension() { - performDelegateTest(UIPickerViewSubclass(frame: CGRect.zero)) { ExtendPickerViewDelegateProxy(parentObject: $0) } + performDelegateTest(UIPickerViewSubclass(frame: CGRect.zero)) { ExtendPickerViewDelegateProxy(pickerViewSubclass: $0) } } func test_UIPickerViewDataSourceExtension() { - performDelegateTest(UIPickerViewSubclass2(frame: CGRect.zero)) { ExtendPickerViewDataSourceProxy(parentObject: $0) } + performDelegateTest(UIPickerViewSubclass2(frame: CGRect.zero)) { ExtendPickerViewDataSourceProxy(pickerViewSubclass: $0) } } } #endif @@ -84,20 +84,20 @@ extension DelegateProxyTest { #if os(iOS) extension DelegateProxyTest { func test_UIWebViewDelegateExtension() { - performDelegateTest(UIWebViewSubclass(frame: CGRect.zero)) { ExtendWebViewDelegateProxy(parentObject: $0) } + performDelegateTest(UIWebViewSubclass(frame: CGRect.zero)) { ExtendWebViewDelegateProxy(webViewSubclass: $0) } } } #endif extension DelegateProxyTest { func test_UITabBarControllerDelegateExtension() { - performDelegateTest(UITabBarControllerSubclass()) { ExtendTabBarControllerDelegateProxy(parentObject: $0) } + performDelegateTest(UITabBarControllerSubclass()) { ExtendTabBarControllerDelegateProxy(tabBarControllerSubclass: $0) } } } extension DelegateProxyTest { func test_UITabBarDelegateExtension() { - performDelegateTest(UITabBarSubclass()) { ExtendTabBarDelegateProxy(parentObject: $0) } + performDelegateTest(UITabBarSubclass()) { ExtendTabBarDelegateProxy(tabBarSubclass: $0) } } } @@ -115,9 +115,9 @@ final class ExtendTableViewDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UITableViewSubclass1? - override init(parentObject: UITableView) { - self.control = parentObject as? UITableViewSubclass1 - super.init(parentObject: parentObject) + init(tableViewSubclass: UITableViewSubclass1) { + self.control = tableViewSubclass + super.init(tableView: tableViewSubclass) } } @@ -142,9 +142,9 @@ final class ExtendTableViewDataSourceProxy , TestDelegateProtocol { weak fileprivate(set) var control: UITableViewSubclass2? - init(parentObject: UITableViewSubclass2) { - self.control = parentObject - super.init(parentObject: parentObject) + init(tableViewSubclass: UITableViewSubclass2) { + self.control = tableViewSubclass + super.init(tableView: tableViewSubclass) } } @@ -173,7 +173,7 @@ final class ExtendCollectionViewDelegateProxy init(parentObject: UICollectionViewSubclass1) { self.control = parentObject - super.init(parentObject: parentObject) + super.init(collectionView: parentObject) } } @@ -200,7 +200,7 @@ final class ExtendCollectionViewDataSourceProxy init(parentObject: UICollectionViewSubclass2) { self.control = parentObject - super.init(parentObject: parentObject) + super.init(collectionView: parentObject) } } @@ -228,9 +228,9 @@ final class ExtendScrollViewDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UIScrollViewSubclass? - override init(parentObject: ParentObject) { - self.control = parentObject as? UIScrollViewSubclass - super.init(parentObject: parentObject) + init(scrollViewSubclass: UIScrollViewSubclass) { + self.control = scrollViewSubclass + super.init(scrollView: scrollViewSubclass) } } @@ -256,9 +256,9 @@ final class ExtendSearchBarDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UISearchBarSubclass? - override init(parentObject: ParentObject) { - self.control = parentObject as? UISearchBarSubclass - super.init(parentObject: parentObject) + init(searchBarSubclass: UISearchBarSubclass) { + self.control = searchBarSubclass + super.init(searchBar: searchBarSubclass) } } @@ -284,9 +284,9 @@ final class ExtendTextViewDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UITextViewSubclass? - init(parentObject: UITextViewSubclass) { - self.control = parentObject - super.init(parentObject: parentObject) + init(textViewSubclass: UITextViewSubclass) { + self.control = textViewSubclass + super.init(textView: textViewSubclass) } } @@ -309,8 +309,8 @@ final class UITextViewSubclass final class ExtendSearchControllerDelegateProxy : RxSearchControllerDelegateProxy , TestDelegateProtocol { - override init(parentObject: ParentObject) { - super.init(parentObject: parentObject) + init(searchControllerSubclass: UISearchControllerSubclass) { + super.init(searchController: searchControllerSubclass) } } @@ -334,8 +334,8 @@ final class UISearchControllerSubclass final class ExtendPickerViewDelegateProxy : RxPickerViewDelegateProxy , TestDelegateProtocol { - override init(parentObject: ParentObject) { - super.init(parentObject: parentObject) + init(pickerViewSubclass: UIPickerViewSubclass) { + super.init(pickerView: pickerViewSubclass) } } @@ -362,9 +362,9 @@ final class ExtendPickerViewDataSourceProxy , TestDelegateProtocol { weak fileprivate(set) var control: UIPickerViewSubclass2? - init(parentObject: UIPickerViewSubclass2) { - self.control = parentObject - super.init(parentObject: parentObject) + init(pickerViewSubclass: UIPickerViewSubclass2) { + self.control = pickerViewSubclass + super.init(pickerView: pickerViewSubclass) } } @@ -387,8 +387,8 @@ final class UIPickerViewSubclass2: UIPickerView, TestDelegateControl { final class ExtendWebViewDelegateProxy : RxWebViewDelegateProxy , TestDelegateProtocol { - override init(parentObject: ParentObject) { - super.init(parentObject: parentObject) + init(webViewSubclass: UIWebViewSubclass) { + super.init(webView: webViewSubclass) } } @@ -417,8 +417,8 @@ final class ExtendTextStorageDelegateProxy : RxTextStorageDelegateProxy , TestDelegateProtocol { - override init(parentObject: ParentObject) { - super.init(parentObject: parentObject) + init(textStorageSubclass: NSTextStorageSubclass) { + super.init(textStorage: textStorageSubclass) } } @@ -443,20 +443,20 @@ final class ExtendNavigationControllerDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UINavigationControllerSubclass? - override init(parentObject: ParentObject) { - self.control = parentObject as? UINavigationControllerSubclass - super.init(parentObject: parentObject) + init(navigationControllerSubclass: UINavigationControllerSubclass) { + self.control = navigationControllerSubclass + super.init(navigationController: navigationControllerSubclass) } } final class ExtendTabBarControllerDelegateProxy : RxTabBarControllerDelegateProxy , TestDelegateProtocol { - weak fileprivate(set) var control: UITabBarControllerSubclass? + weak fileprivate(set) var tabBarControllerSubclass: UITabBarControllerSubclass? - override init(parentObject: ParentObject) { - self.control = parentObject as? UITabBarControllerSubclass - super.init(parentObject: parentObject) + init(tabBarControllerSubclass: UITabBarControllerSubclass) { + self.tabBarControllerSubclass = tabBarControllerSubclass + super.init(tabBar: tabBarControllerSubclass) } } @@ -465,9 +465,9 @@ final class ExtendTabBarDelegateProxy , TestDelegateProtocol { weak fileprivate(set) var control: UITabBarSubclass? - override init(parentObject: ParentObject) { - self.control = parentObject as? UITabBarSubclass - super.init(parentObject: parentObject) + init(tabBarSubclass: UITabBarSubclass) { + self.control = tabBarSubclass + super.init(tabBar: tabBarSubclass) } }