Skip to content

Commit

Permalink
Release 4.0.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaher committed Sep 17, 2017
1 parent efe3af1 commit a0bf386
Show file tree
Hide file tree
Showing 33 changed files with 74 additions and 1,699 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,27 @@ All notable changes to this project will be documented in this file.
## Master

* Adds `materialize()` operator for RxBlocking's `BlockingObservable`. #1383
* Adds `first` operator to ObservableType.
* Adds `first` operator to `ObservableType`.

#### Anomalies

* Call `controlTextDidChange(…)` as an optional method. #1406
* Fixed issue with `NSControl.rx.value` regarding multiple observers. #1399

## [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
* Adds `first` operator to `ObservableType`.
* Deprecates `UIBindingObserver` in favor of `Binder`. #1411
* Adds another specialization of `SharedSequence` called `Signal`.
* Refactors `DelegateProxy` to be type safe.
* Changes nested `SharedSequence` strategy to use inner sharing strategy for result.

#### Anomalies

* Call `controlTextDidChange(…)` as an optional method. #1406
* Fixed issue with `NSControl.rx.value` regarding multiple observers. #1399
* Removes useless extensions from `PrimitiveSequence`. #1248

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

Expand Down
4 changes: 2 additions & 2 deletions RxBlocking.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxBlocking"
s.version = "4.0.0-alpha.1"
s.version = "4.0.0-beta.0"
s.summary = "RxSwift Blocking operatos"
s.description = <<-DESC
Set of blocking operators for RxSwift. These operators are mostly intended for unit/integration tests
Expand All @@ -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-alpha.1'
s.dependency 'RxSwift', '~> 4.0.0-beta.0'
end
Binary file modified RxBlocking/Info.plist
Binary file not shown.
4 changes: 2 additions & 2 deletions RxCocoa.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxCocoa"
s.version = "4.0.0-alpha.1"
s.version = "4.0.0-beta.0"
s.summary = "RxSwift Cocoa extensions"
s.description = <<-DESC
* UI extensions
Expand All @@ -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-alpha.1'
s.dependency 'RxSwift', '~> 4.0.0-beta.0'
end
Binary file modified RxCocoa/Info.plist
Binary file not shown.
14 changes: 11 additions & 3 deletions RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ import CoreLocation
import RxCocoa
#endif

class RxCLLocationManagerDelegateProxy
public class RxCLLocationManagerDelegateProxy
: DelegateProxy<CLLocationManager, CLLocationManagerDelegate>
, DelegateProxyType
, CLLocationManagerDelegate {

public init(parentObject: CLLocationManager) {
super.init(parentObject: parentObject, delegateProxy: RxCLLocationManagerDelegateProxy.self)
}

public static func registerKnownImplementations() {
self.register { RxCLLocationManagerDelegateProxy(parentObject: $0) }
}

internal lazy var didUpdateLocationsSubject = PublishSubject<[CLLocation]>()
internal lazy var didFailWithErrorSubject = PublishSubject<Error>()

override class func currentDelegate(for object: ParentObject) -> CLLocationManagerDelegate? {
public class func currentDelegate(for object: ParentObject) -> CLLocationManagerDelegate? {
return object.delegate
}

override class func setCurrentDelegate(_ delegate: CLLocationManagerDelegate?, toObject object: ParentObject) {
public class func setCurrentDelegate(_ delegate: CLLocationManagerDelegate?, to object: ParentObject) {
object.delegate = delegate
}

Expand Down
6 changes: 5 additions & 1 deletion RxExample/Extensions/RxImagePickerDelegateProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

open class RxImagePickerDelegateProxy
: RxNavigationControllerDelegateProxy, UIImagePickerControllerDelegate {


public init(parentObject: UIImagePickerController) {
super.init(parentObject: parentObject)
}

}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModel
Collection view behaves poorly during fast updates, so this should remedy those issues.
*/
open func collectionView(_ collectionView: UICollectionView, throttledObservedEvent event: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, newSections in
Binder(self) { dataSource, newSections in
let oldSections = dataSource.sectionModels
do {
let differences = try differencesForSectionedView(oldSections, finalSections: newSections)
Expand All @@ -77,7 +77,7 @@ open class RxCollectionViewSectionedAnimatedDataSource<S: AnimatableSectionModel
}

open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, newSections in
Binder(self) { dataSource, newSections in
#if DEBUG
self._dataSourceBound = true
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open class RxCollectionViewSectionedReloadDataSource<S: SectionModelType>
}

open func collectionView(_ collectionView: UICollectionView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, element in
Binder(self) { dataSource, element in
#if DEBUG
self._dataSourceBound = true
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ open class RxTableViewSectionedAnimatedDataSource<S: AnimatableSectionModelType>
}

open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, newSections in
Binder(self) { dataSource, newSections in
#if DEBUG
self._dataSourceBound = true
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ open class RxTableViewSectionedReloadDataSource<S: SectionModelType>
}

open func tableView(_ tableView: UITableView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { dataSource, element in
Binder(self) { dataSource, element in
#if DEBUG
self._dataSourceBound = true
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import RxSwift
import RxCocoa
import XCTest
import CoreLocation
import RxExample_iOS

class CLLocationManagerTests : RxTest {

Expand Down
4 changes: 4 additions & 0 deletions RxExample/RxExample-iOSTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We use it</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We use it</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
2 changes: 1 addition & 1 deletion RxExample/RxExample-iOSTests/RxExample_iOSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class RxExample_iOSTests

This method enables using mock schedulers for while testing drivers.
*/
driveOnScheduler(scheduler) {
SharingScheduler.mock(scheduler: scheduler) {

let viewModel = GithubSignupViewModel2(
input: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import RxSwift
import RxCocoa
import XCTest
import UIKit
import RxExample_iOS

class UIImagePickerControllerTests: RxTest {

Expand Down
8 changes: 0 additions & 8 deletions RxExample/RxExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@
C886A6911D85AD7E00653EE4 /* CLLocationManager+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6901D85AD7E00653EE4 /* CLLocationManager+RxTests.swift */; };
C886A6931D85ADA100653EE4 /* UIImagePickerController+RxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6921D85ADA100653EE4 /* UIImagePickerController+RxTests.swift */; };
C886A6951D85AEA300653EE4 /* RxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A6941D85AEA300653EE4 /* RxTest.swift */; };
C886A6991D85B0E400653EE4 /* CLLocationManager+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68C1D85AD2000653EE4 /* CLLocationManager+Rx.swift */; };
C886A69A1D85B0E400653EE4 /* RxCLLocationManagerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68D1D85AD2000653EE4 /* RxCLLocationManagerDelegateProxy.swift */; };
C886A69B1D85B0E500653EE4 /* UIImagePickerController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C886A68A1D85AC9400653EE4 /* UIImagePickerController+Rx.swift */; };
C88BB8BB1B07E6C90064D411 /* SearchResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86E2F321AE5A0CA00C31024 /* SearchResultViewModel.swift */; };
C88BB8BC1B07E6C90064D411 /* HtmlParsing.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83367111AD029AE00C668A7 /* HtmlParsing.swift */; };
C88BB8BE1B07E6C90064D411 /* ImageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C83367121AD029AE00C668A7 /* ImageService.swift */; };
Expand All @@ -136,7 +133,6 @@
C88BB8CC1B07E6C90064D411 /* WikipediaPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86E2F3C1AE5A0CA00C31024 /* WikipediaPage.swift */; };
C88C2B2A1D67EC5200B01A98 /* FlowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88C2B291D67EC5200B01A98 /* FlowTests.swift */; };
C88CB7261D8F253D0021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB7251D8F253D0021D83F /* RxImagePickerDelegateProxy.swift */; };
C88CB73B1D8F25440021D83F /* RxImagePickerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C88CB7251D8F253D0021D83F /* RxImagePickerDelegateProxy.swift */; };
C890A65D1AEC084100AFF7E6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C890A65C1AEC084100AFF7E6 /* ViewController.swift */; };
C89634081B95BE50002AE38C /* RxBlocking.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468EF1B8A8BD000BF917B /* RxBlocking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C89634091B95BE50002AE38C /* RxCocoa.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8A468ED1B8A8BCC00BF917B /* RxCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -1558,13 +1554,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C886A6991D85B0E400653EE4 /* CLLocationManager+Rx.swift in Sources */,
C89C2BD61C321DA200EBC99C /* TestScheduler+MarbleTests.swift in Sources */,
C886A6951D85AEA300653EE4 /* RxTest.swift in Sources */,
C849EF901C319E9A0048AC4A /* GithubSignupViewModel1.swift in Sources */,
C849EF641C3190360048AC4A /* RxExample_iOSTests.swift in Sources */,
C886A69B1D85B0E500653EE4 /* UIImagePickerController+Rx.swift in Sources */,
C88CB73B1D8F25440021D83F /* RxImagePickerDelegateProxy.swift in Sources */,
C886A6911D85AD7E00653EE4 /* CLLocationManager+RxTests.swift in Sources */,
C849EF921C319E9A0048AC4A /* DefaultImplementations.swift in Sources */,
C849EF991C31A63C0048AC4A /* Wireframe.swift in Sources */,
Expand All @@ -1573,7 +1566,6 @@
C849EF9A1C31A7680048AC4A /* ActivityIndicator.swift in Sources */,
C849EF951C319E9D0048AC4A /* GithubSignupViewModel2.swift in Sources */,
C886A6931D85ADA100653EE4 /* UIImagePickerController+RxTests.swift in Sources */,
C886A69A1D85B0E400653EE4 /* RxCLLocationManagerDelegateProxy.swift in Sources */,
C89C2BDD1C32231A00EBC99C /* MockWireframe.swift in Sources */,
C89C2BDF1C32231A00EBC99C /* ValidationResult+Equatable.swift in Sources */,
C849EF911C319E9A0048AC4A /* Protocols.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -30,6 +31,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import CoreLocation
#endif

private extension Reactive where Base: UILabel {
var coordinates: UIBindingObserver<Base, CLLocationCoordinate2D> {
return UIBindingObserver(UIElement: base) { label, location in
var coordinates: Binder<CLLocationCoordinate2D> {
return Binder(base) { label, location in
label.text = "Lat: \(location.latitude)\nLon: \(location.longitude)"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ struct Colors {
}

extension Reactive where Base: UINavigationController {
var isOffline: UIBindingObserver<Base, Bool> {
return UIBindingObserver(UIElement: base) { navigationController, isOffline in
var isOffline: Binder<Bool> {
return Binder(base) { navigationController, isOffline in
navigationController.navigationBar.barTintColor = isOffline
? Colors.offlineColor
: Colors.onlineColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ extension ValidationResult {
}

extension Reactive where Base: UILabel {
var validationResult: UIBindingObserver<Base, ValidationResult> {
return UIBindingObserver(UIElement: base) { label, result in
var validationResult: Binder<ValidationResult> {
return Binder(base) { label, result in
label.textColor = result.textColor
label.text = result.description
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ final class PickerViewViewAdapter
}

func pickerView(_ pickerView: UIPickerView, observedEvent: Event<Element>) {
UIBindingObserver(UIElement: self) { (adapter, items) in
Binder(self) { (adapter, items) in
adapter.items = items
pickerView.reloadAllComponents()
}.on(observedEvent)
}.on(observedEvent)
}
}

Expand Down
2 changes: 2 additions & 0 deletions RxExample/RxExample/Info-iOS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need location</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import UIKit

extension Reactive where Base: UIImageView {

var downloadableImage: UIBindingObserver<Base, DownloadableImage>{
var downloadableImage: Binder<DownloadableImage>{
return downloadableImageAnimated(nil)
}

func downloadableImageAnimated(_ transitionType:String?) -> UIBindingObserver<Base, DownloadableImage> {
return UIBindingObserver(UIElement: base) { imageView, image in
func downloadableImageAnimated(_ transitionType:String?) -> Binder<DownloadableImage> {
return Binder(base) { imageView, image in
for subview in imageView.subviews {
subview.removeFromSuperview()
}
Expand Down
5 changes: 2 additions & 3 deletions RxExample/RxExample/iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if UIApplication.isInUITest {
UIView.setAnimationsEnabled(false)
}

// Install delegate proxy
RxImagePickerDelegateProxy.register(for: UIImagePickerController.self)

RxImagePickerDelegateProxy.register { RxImagePickerDelegateProxy(parentObject: $0) }

#if DEBUG
_ = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
Expand Down
2 changes: 1 addition & 1 deletion RxSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxSwift"
s.version = "4.0.0-alpha.1"
s.version = "4.0.0-beta.0"
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)
Expand Down
2 changes: 1 addition & 1 deletion RxSwift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.0.0-alpha.1</string>
<string>4.0.0-beta.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions RxTest.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxTest"
s.version = "4.0.0-alpha.1"
s.version = "4.0.0-beta.0"
s.summary = "RxSwift Testing extensions"
s.description = <<-DESC
Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers
Expand Down Expand Up @@ -56,7 +56,7 @@ func testMap() {

s.framework = 'XCTest'

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

s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
end
Binary file modified RxTest/Info.plist
Binary file not shown.
1 change: 0 additions & 1 deletion Sources/AllTestz/PrimitiveSequenceTest.swift

This file was deleted.

Loading

0 comments on commit a0bf386

Please sign in to comment.