Skip to content

Commit a0bf386

Browse files
committed
Release 4.0.0-beta.0
1 parent efe3af1 commit a0bf386

33 files changed

+74
-1699
lines changed

CHANGELOG.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,27 @@ All notable changes to this project will be documented in this file.
66
## Master
77

88
* Adds `materialize()` operator for RxBlocking's `BlockingObservable`. #1383
9-
* Adds `first` operator to ObservableType.
9+
* Adds `first` operator to `ObservableType`.
10+
11+
#### Anomalies
12+
13+
* Call `controlTextDidChange(…)` as an optional method. #1406
14+
* Fixed issue with `NSControl.rx.value` regarding multiple observers. #1399
15+
16+
## [4.0.0-beta.0](https://github.com/ReactiveX/RxSwift/releases/tag/4.0.0-beta.0)
17+
18+
* Adds `materialize()` operator for RxBlocking's `BlockingObservable`. #1383
19+
* Adds `first` operator to `ObservableType`.
20+
* Deprecates `UIBindingObserver` in favor of `Binder`. #1411
21+
* Adds another specialization of `SharedSequence` called `Signal`.
22+
* Refactors `DelegateProxy` to be type safe.
23+
* Changes nested `SharedSequence` strategy to use inner sharing strategy for result.
24+
25+
#### Anomalies
26+
27+
* Call `controlTextDidChange(…)` as an optional method. #1406
28+
* Fixed issue with `NSControl.rx.value` regarding multiple observers. #1399
29+
* Removes useless extensions from `PrimitiveSequence`. #1248
1030

1131
## [4.0.0-alpha.1](https://github.com/ReactiveX/RxSwift/releases/tag/4.0.0-alpha.1)
1232

RxBlocking.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxBlocking"
3-
s.version = "4.0.0-alpha.1"
3+
s.version = "4.0.0-beta.0"
44
s.summary = "RxSwift Blocking operatos"
55
s.description = <<-DESC
66
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
2525
s.source_files = 'RxBlocking/**/*.swift', 'Platform/**/*.swift'
2626
s.exclude_files = 'RxBlocking/Platform/**/*.swift'
2727

28-
s.dependency 'RxSwift', '~> 4.0.0-alpha.1'
28+
s.dependency 'RxSwift', '~> 4.0.0-beta.0'
2929
end

RxBlocking/Info.plist

358 Bytes
Binary file not shown.

RxCocoa.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxCocoa"
3-
s.version = "4.0.0-alpha.1"
3+
s.version = "4.0.0-beta.0"
44
s.summary = "RxSwift Cocoa extensions"
55
s.description = <<-DESC
66
* UI extensions
@@ -27,5 +27,5 @@ Pod::Spec.new do |s|
2727
s.watchos.source_files = 'RxCocoa/iOS/**/*.swift'
2828
s.tvos.source_files = 'RxCocoa/iOS/**/*.swift'
2929

30-
s.dependency 'RxSwift', '~> 4.0.0-alpha.1'
30+
s.dependency 'RxSwift', '~> 4.0.0-beta.0'
3131
end

RxCocoa/Info.plist

358 Bytes
Binary file not shown.

RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,27 @@ import CoreLocation
1212
import RxCocoa
1313
#endif
1414

15-
class RxCLLocationManagerDelegateProxy
15+
public class RxCLLocationManagerDelegateProxy
1616
: DelegateProxy<CLLocationManager, CLLocationManagerDelegate>
1717
, DelegateProxyType
1818
, CLLocationManagerDelegate {
1919

20+
public init(parentObject: CLLocationManager) {
21+
super.init(parentObject: parentObject, delegateProxy: RxCLLocationManagerDelegateProxy.self)
22+
}
23+
24+
public static func registerKnownImplementations() {
25+
self.register { RxCLLocationManagerDelegateProxy(parentObject: $0) }
26+
}
27+
2028
internal lazy var didUpdateLocationsSubject = PublishSubject<[CLLocation]>()
2129
internal lazy var didFailWithErrorSubject = PublishSubject<Error>()
2230

23-
override class func currentDelegate(for object: ParentObject) -> CLLocationManagerDelegate? {
31+
public class func currentDelegate(for object: ParentObject) -> CLLocationManagerDelegate? {
2432
return object.delegate
2533
}
2634

27-
override class func setCurrentDelegate(_ delegate: CLLocationManagerDelegate?, toObject object: ParentObject) {
35+
public class func setCurrentDelegate(_ delegate: CLLocationManagerDelegate?, to object: ParentObject) {
2836
object.delegate = delegate
2937
}
3038

RxExample/Extensions/RxImagePickerDelegateProxy.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616

1717
open class RxImagePickerDelegateProxy
1818
: RxNavigationControllerDelegateProxy, UIImagePickerControllerDelegate {
19-
19+
20+
public init(parentObject: UIImagePickerController) {
21+
super.init(parentObject: parentObject)
22+
}
23+
2024
}
2125

2226
#endif

RxExample/RxDataSources/DataSources+Rx/RxCollectionViewSectionedAnimatedDataSource.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModel
5454
Collection view behaves poorly during fast updates, so this should remedy those issues.
5555
*/
5656
open func collectionView(_ collectionView: UICollectionView, throttledObservedEvent event: Event<Element>) {
57-
UIBindingObserver(UIElement: self) { dataSource, newSections in
57+
Binder(self) { dataSource, newSections in
5858
let oldSections = dataSource.sectionModels
5959
do {
6060
let differences = try differencesForSectionedView(oldSections, finalSections: newSections)
@@ -77,7 +77,7 @@ open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModel
7777
}
7878

7979
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
80-
UIBindingObserver(UIElement: self) { dataSource, newSections in
80+
Binder(self) { dataSource, newSections in
8181
#if DEBUG
8282
self._dataSourceBound = true
8383
#endif

RxExample/RxDataSources/DataSources+Rx/RxCollectionViewSectionedReloadDataSource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ open class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
2424
}
2525

2626
open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
27-
UIBindingObserver(UIElement: self) { dataSource, element in
27+
Binder(self) { dataSource, element in
2828
#if DEBUG
2929
self._dataSourceBound = true
3030
#endif

RxExample/RxDataSources/DataSources+Rx/RxTableViewSectionedAnimatedDataSource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ open class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
2727
}
2828

2929
open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
30-
UIBindingObserver(UIElement: self) { dataSource, newSections in
30+
Binder(self) { dataSource, newSections in
3131
#if DEBUG
3232
self._dataSourceBound = true
3333
#endif

RxExample/RxDataSources/DataSources+Rx/RxTableViewSectionedReloadDataSource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class RxTableViewSectionedReloadDataSource<S: SectionModelType>
2323
}
2424

2525
open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
26-
UIBindingObserver(UIElement: self) { dataSource, element in
26+
Binder(self) { dataSource, element in
2727
#if DEBUG
2828
self._dataSourceBound = true
2929
#endif

RxExample/RxExample-iOSTests/CLLocationManager+RxTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import RxSwift
1010
import RxCocoa
1111
import XCTest
1212
import CoreLocation
13+
import RxExample_iOS
1314

1415
class CLLocationManagerTests : RxTest {
1516

RxExample/RxExample-iOSTests/Info.plist

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
6+
<string>We use it</string>
7+
<key>NSLocationWhenInUseUsageDescription</key>
8+
<string>We use it</string>
59
<key>CFBundleDevelopmentRegion</key>
610
<string>en</string>
711
<key>CFBundleExecutable</key>

RxExample/RxExample-iOSTests/RxExample_iOSTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class RxExample_iOSTests
140140

141141
This method enables using mock schedulers for while testing drivers.
142142
*/
143-
driveOnScheduler(scheduler) {
143+
SharingScheduler.mock(scheduler: scheduler) {
144144

145145
let viewModel = GithubSignupViewModel2(
146146
input: (

RxExample/RxExample-iOSTests/UIImagePickerController+RxTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import RxSwift
1414
import RxCocoa
1515
import XCTest
1616
import UIKit
17+
import RxExample_iOS
1718

1819
class UIImagePickerControllerTests: RxTest {
1920

RxExample/RxExample.xcodeproj/project.pbxproj

-8
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@
122122
C886A6911D85AD7E00653EE4 /* CLLocationManager+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6901D85AD7E00653EE4 /* CLLocationManager+RxTests.swift */; };
123123
C886A6931D85ADA100653EE4 /* UIImagePickerController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6921D85ADA100653EE4 /* UIImagePickerController+RxTests.swift */; };
124124
C886A6951D85AEA300653EE4 /* RxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6941D85AEA300653EE4 /* RxTest.swift */; };
125-
C886A6991D85B0E400653EE4 /* CLLocationManager+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68C1D85AD2000653EE4 /* CLLocationManager+Rx.swift */; };
126-
C886A69A1D85B0E400653EE4 /* RxCLLocationManagerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68D1D85AD2000653EE4 /* RxCLLocationManagerDelegateProxy.swift */; };
127-
C886A69B1D85B0E500653EE4 /* UIImagePickerController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68A1D85AC9400653EE4 /* UIImagePickerController+Rx.swift */; };
128125
C88BB8BB1B07E6C90064D411 /* SearchResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86E2F321AE5A0CA00C31024 /* SearchResultViewModel.swift */; };
129126
C88BB8BC1B07E6C90064D411 /* HtmlParsing.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83367111AD029AE00C668A7 /* HtmlParsing.swift */; };
130127
C88BB8BE1B07E6C90064D411 /* ImageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83367121AD029AE00C668A7 /* ImageService.swift */; };
@@ -136,7 +133,6 @@
136133
C88BB8CC1B07E6C90064D411 /* WikipediaPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86E2F3C1AE5A0CA00C31024 /* WikipediaPage.swift */; };
137134
C88C2B2A1D67EC5200B01A98 /* FlowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88C2B291D67EC5200B01A98 /* FlowTests.swift */; };
138135
C88CB7261D8F253D0021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB7251D8F253D0021D83F /* RxImagePickerDelegateProxy.swift */; };
139-
C88CB73B1D8F25440021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB7251D8F253D0021D83F /* RxImagePickerDelegateProxy.swift */; };
140136
C890A65D1AEC084100AFF7E6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C890A65C1AEC084100AFF7E6 /* ViewController.swift */; };
141137
C89634081B95BE50002AE38C /* RxBlocking.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468EF1B8A8BD000BF917B /* RxBlocking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
142138
C89634091B95BE50002AE38C /* RxCocoa.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468ED1B8A8BCC00BF917B /* RxCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -1558,13 +1554,10 @@
15581554
isa = PBXSourcesBuildPhase;
15591555
buildActionMask = 2147483647;
15601556
files = (
1561-
C886A6991D85B0E400653EE4 /* CLLocationManager+Rx.swift in Sources */,
15621557
C89C2BD61C321DA200EBC99C /* TestScheduler+MarbleTests.swift in Sources */,
15631558
C886A6951D85AEA300653EE4 /* RxTest.swift in Sources */,
15641559
C849EF901C319E9A0048AC4A /* GithubSignupViewModel1.swift in Sources */,
15651560
C849EF641C3190360048AC4A /* RxExample_iOSTests.swift in Sources */,
1566-
C886A69B1D85B0E500653EE4 /* UIImagePickerController+Rx.swift in Sources */,
1567-
C88CB73B1D8F25440021D83F /* RxImagePickerDelegateProxy.swift in Sources */,
15681561
C886A6911D85AD7E00653EE4 /* CLLocationManager+RxTests.swift in Sources */,
15691562
C849EF921C319E9A0048AC4A /* DefaultImplementations.swift in Sources */,
15701563
C849EF991C31A63C0048AC4A /* Wireframe.swift in Sources */,
@@ -1573,7 +1566,6 @@
15731566
C849EF9A1C31A7680048AC4A /* ActivityIndicator.swift in Sources */,
15741567
C849EF951C319E9D0048AC4A /* GithubSignupViewModel2.swift in Sources */,
15751568
C886A6931D85ADA100653EE4 /* UIImagePickerController+RxTests.swift in Sources */,
1576-
C886A69A1D85B0E400653EE4 /* RxCLLocationManagerDelegateProxy.swift in Sources */,
15771569
C89C2BDD1C32231A00EBC99C /* MockWireframe.swift in Sources */,
15781570
C89C2BDF1C32231A00EBC99C /* ValidationResult+Equatable.swift in Sources */,
15791571
C849EF911C319E9A0048AC4A /* Protocols.swift in Sources */,

RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOSTests.xcscheme

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
language = ""
1314
shouldUseLaunchSchemeArgsEnv = "YES">
1415
<Testables>
1516
<TestableReference
@@ -30,6 +31,7 @@
3031
buildConfiguration = "Debug"
3132
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3233
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
34+
language = ""
3335
launchStyle = "0"
3436
useCustomWorkingDirectory = "NO"
3537
ignoresPersistentStateOnLaunch = "NO"

RxExample/RxExample/Examples/GeolocationExample/GeolocationViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import CoreLocation
1414
#endif
1515

1616
private extension Reactive where Base: UILabel {
17-
var coordinates: UIBindingObserver<Base, CLLocationCoordinate2D> {
18-
return UIBindingObserver(UIElement: base) { label, location in
17+
var coordinates: Binder<CLLocationCoordinate2D> {
18+
return Binder(base) { label, location in
1919
label.text = "Lat: \(location.latitude)\nLon: \(location.longitude)"
2020
}
2121
}

RxExample/RxExample/Examples/GitHubSearchRepositories/UINavigationController+Extensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ struct Colors {
1616
}
1717

1818
extension Reactive where Base: UINavigationController {
19-
var isOffline: UIBindingObserver<Base, Bool> {
20-
return UIBindingObserver(UIElement: base) { navigationController, isOffline in
19+
var isOffline: Binder<Bool> {
20+
return Binder(base) { navigationController, isOffline in
2121
navigationController.navigationBar.barTintColor = isOffline
2222
? Colors.offlineColor
2323
: Colors.onlineColor

RxExample/RxExample/Examples/GitHubSignup/BindingExtensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ extension ValidationResult {
4848
}
4949

5050
extension Reactive where Base: UILabel {
51-
var validationResult: UIBindingObserver<Base, ValidationResult> {
52-
return UIBindingObserver(UIElement: base) { label, result in
51+
var validationResult: Binder<ValidationResult> {
52+
return Binder(base) { label, result in
5353
label.textColor = result.textColor
5454
label.text = result.description
5555
}

RxExample/RxExample/Examples/UIPickerViewExample/CustomPickerViewAdapterExampleViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ final class PickerViewViewAdapter
6161
}
6262

6363
func pickerView(_ pickerView: UIPickerView, observedEvent: Event<Element>) {
64-
UIBindingObserver(UIElement: self) { (adapter, items) in
64+
Binder(self) { (adapter, items) in
6565
adapter.items = items
6666
pickerView.reloadAllComponents()
67-
}.on(observedEvent)
67+
}.on(observedEvent)
6868
}
6969
}
7070

RxExample/RxExample/Info-iOS.plist

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSLocationWhenInUseUsageDescription</key>
6+
<string>We need location</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleExecutable</key>

RxExample/RxExample/Services/UIImageView+DownloadableImage.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import UIKit
1515

1616
extension Reactive where Base: UIImageView {
1717

18-
var downloadableImage: UIBindingObserver<Base, DownloadableImage>{
18+
var downloadableImage: Binder<DownloadableImage>{
1919
return downloadableImageAnimated(nil)
2020
}
2121

22-
func downloadableImageAnimated(_ transitionType:String?) -> UIBindingObserver<Base, DownloadableImage> {
23-
return UIBindingObserver(UIElement: base) { imageView, image in
22+
func downloadableImageAnimated(_ transitionType:String?) -> Binder<DownloadableImage> {
23+
return Binder(base) { imageView, image in
2424
for subview in imageView.subviews {
2525
subview.removeFromSuperview()
2626
}

RxExample/RxExample/iOS/AppDelegate.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1818
if UIApplication.isInUITest {
1919
UIView.setAnimationsEnabled(false)
2020
}
21-
22-
// Install delegate proxy
23-
RxImagePickerDelegateProxy.register(for: UIImagePickerController.self)
21+
22+
RxImagePickerDelegateProxy.register { RxImagePickerDelegateProxy(parentObject: $0) }
2423

2524
#if DEBUG
2625
_ = Observable<Int>.interval(1, scheduler: MainScheduler.instance)

RxSwift.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxSwift"
3-
s.version = "4.0.0-alpha.1"
3+
s.version = "4.0.0-beta.0"
44
s.summary = "RxSwift is a Swift implementation of Reactive Extensions"
55
s.description = <<-DESC
66
This is a Swift port of [ReactiveX.io](https://github.com/ReactiveX)

RxSwift/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>4.0.0-alpha.1</string>
18+
<string>4.0.0-beta.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

RxTest.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxTest"
3-
s.version = "4.0.0-alpha.1"
3+
s.version = "4.0.0-beta.0"
44
s.summary = "RxSwift Testing extensions"
55
s.description = <<-DESC
66
Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers
@@ -56,7 +56,7 @@ func testMap() {
5656

5757
s.framework = 'XCTest'
5858

59-
s.dependency 'RxSwift', '~> 4.0.0-alpha.1'
59+
s.dependency 'RxSwift', '~> 4.0.0-beta.0'
6060

6161
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
6262
end

RxTest/Info.plist

358 Bytes
Binary file not shown.

Sources/AllTestz/PrimitiveSequenceTest.swift

-1
This file was deleted.

0 commit comments

Comments
 (0)