Skip to content

Commit f441ecf

Browse files
committed
Merge tag '2.6.1' into rxswift-2.0
2 parents 03636fa + dd4574c commit f441ecf

22 files changed

+1241
-97
lines changed

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.3

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55

66
## Master
77

8+
## [2.6.1](https://github.com/ReactiveX/RxSwift/releases/tag/2.6.0)
9+
10+
#### Anomalies
11+
12+
* Fixes issues with locking strategy for subjects. #936
13+
* Improves behavior of data sources on iOS 10. #999
14+
815
## [2.6.0](https://github.com/ReactiveX/RxSwift/releases/tag/2.6.0)
916

1017
#### Features

Rx.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@
660660
C8941BE71BD56B0700A0E874 /* BlockingObservable+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8941BE31BD56B0700A0E874 /* BlockingObservable+Operators.swift */; };
661661
C89461751BC6C1210055219D /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C849BE2A1BAB5D070019AD27 /* ObservableConvertibleType.swift */; };
662662
C89461761BC6C1220055219D /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C849BE2A1BAB5D070019AD27 /* ObservableConvertibleType.swift */; };
663+
C89579381DE1FD8C00DC9C9C /* Anomalies.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89579351DE1FD8000DC9C9C /* Anomalies.swift */; };
664+
C895793A1DE1FD8D00DC9C9C /* Anomalies.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89579351DE1FD8000DC9C9C /* Anomalies.swift */; };
665+
C895793B1DE1FD8E00DC9C9C /* Anomalies.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89579351DE1FD8000DC9C9C /* Anomalies.swift */; };
663666
C89CDB361BCB0DD7002063D9 /* ShareReplay1.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89CDB351BCB0DD7002063D9 /* ShareReplay1.swift */; };
664667
C89CDB371BCB0DD7002063D9 /* ShareReplay1.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89CDB351BCB0DD7002063D9 /* ShareReplay1.swift */; };
665668
C89CDB381BCB0DD7002063D9 /* ShareReplay1.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89CDB351BCB0DD7002063D9 /* ShareReplay1.swift */; };
@@ -1663,6 +1666,7 @@
16631666
C88FA53F1C25C4CC00CCFEA4 /* RxTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
16641667
C8941BDE1BD5695C00A0E874 /* BlockingObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlockingObservable.swift; sourceTree = "<group>"; };
16651668
C8941BE31BD56B0700A0E874 /* BlockingObservable+Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BlockingObservable+Operators.swift"; sourceTree = "<group>"; };
1669+
C89579351DE1FD8000DC9C9C /* Anomalies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Anomalies.swift; path = Tests/RxSwiftTests/Anomalies.swift; sourceTree = SOURCE_ROOT; };
16661670
C89CDB351BCB0DD7002063D9 /* ShareReplay1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ShareReplay1.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
16671671
C8A56AD71AD7424700B4673B /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
16681672
C8B144FA1BD2D44500267DCE /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConcurrentMainScheduler.swift; sourceTree = "<group>"; };
@@ -2328,6 +2332,7 @@
23282332
C83509011C38706D0027C24C /* Tests */ = {
23292333
isa = PBXGroup;
23302334
children = (
2335+
C89579351DE1FD8000DC9C9C /* Anomalies.swift */,
23312336
C83509021C38706D0027C24C /* AnonymousObservable+Test.swift */,
23322337
C83509031C38706D0027C24C /* AssumptionsTest.swift */,
23332338
C83509041C38706D0027C24C /* BagTest.swift */,
@@ -3473,6 +3478,7 @@
34733478
buildActionMask = 2147483647;
34743479
files = (
34753480
033C2EF61D081C460050C015 /* UIScrollView+RxTests.swift in Sources */,
3481+
C89579381DE1FD8C00DC9C9C /* Anomalies.swift in Sources */,
34763482
C83509661C38706E0027C24C /* RxTest.swift in Sources */,
34773483
C83509611C38706E0027C24C /* ObserverTests.swift in Sources */,
34783484
C83509471C38706E0027C24C /* PrimitiveMockObserver.swift in Sources */,
@@ -3562,6 +3568,7 @@
35623568
C83509F31C38755D0027C24C /* AssumptionsTest.swift in Sources */,
35633569
C83509ED1C3875580027C24C /* MySubject.swift in Sources */,
35643570
C83509C61C3875220027C24C /* NSObject+RxTests.swift in Sources */,
3571+
C895793B1DE1FD8E00DC9C9C /* Anomalies.swift in Sources */,
35653572
C83509BB1C38750D0027C24C /* Control+RxTests.swift in Sources */,
35663573
C83509EE1C3875580027C24C /* Observable.Extensions.swift in Sources */,
35673574
C83509BD1C38750D0027C24C /* ControlPropertyTests.swift in Sources */,
@@ -3679,6 +3686,7 @@
36793686
C83509CC1C3875230027C24C /* NSLayoutConstraint+RxTests.swift in Sources */,
36803687
C8350A0C1C38755E0027C24C /* Observable+CreationTest.swift in Sources */,
36813688
C8350A1C1C38756B0027C24C /* Observable+StandardSequenceOperatorsTest.swift in Sources */,
3689+
C895793A1DE1FD8D00DC9C9C /* Anomalies.swift in Sources */,
36823690
C83509CA1C3875230027C24C /* Driver+Test.swift in Sources */,
36833691
C83509E41C3875580027C24C /* MockDisposable.swift in Sources */,
36843692
C83509D51C38753E0027C24C /* RxObjCRuntimeState.swift in Sources */,

RxBlocking.podspec

Lines changed: 2 additions & 2 deletions
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 = "2.6.0"
3+
s.version = "2.6.1"
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
@@ -24,5 +24,5 @@ Waiting for observable sequence to complete before exiting command line applicat
2424

2525
s.source_files = 'RxBlocking/**/*.swift'
2626

27-
s.dependency 'RxSwift', '~> 2.5'
27+
s.dependency 'RxSwift', '~> 2.6'
2828
end

RxBlocking/Info.plist

0 Bytes
Binary file not shown.

RxCocoa.podspec

Lines changed: 2 additions & 2 deletions
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 = "2.6.0"
3+
s.version = "2.6.1"
44
s.summary = "RxSwift Cocoa extensions"
55
s.description = <<-DESC
66
* UI extensions
@@ -25,5 +25,5 @@ Pod::Spec.new do |s|
2525
s.watchos.source_files = 'RxCocoa/iOS/**/*.swift'
2626
s.tvos.source_files = 'RxCocoa/iOS/**/*.swift'
2727

28-
s.dependency 'RxSwift', '~> 2.5'
28+
s.dependency 'RxSwift', '~> 2.6'
2929
end

RxCocoa/Info.plist

0 Bytes
Binary file not shown.

RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TableViewDataSourceNotSet
2424
}
2525

2626
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
27-
rxAbstractMethodWithMessage(dataSourceNotSet)
27+
return 0
2828
}
2929

3030
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

RxSwift.podspec

Lines changed: 1 addition & 1 deletion
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 = "2.6.0"
3+
s.version = "2.6.1"
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

0 Bytes
Binary file not shown.

RxSwift/Observables/Implementations/ShareReplay1.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ final class ShareReplay1<Element>
7777
}
7878

7979
func on(event: Event<E>) {
80-
_lock.lock(); defer { _lock.unlock() }
81-
_synchronized_on(event)
80+
_synchronized_on(event).on(event)
8281
}
8382

84-
func _synchronized_on(event: Event<E>) {
83+
func _synchronized_on(event: Event<E>) -> Bag<AnyObserver<Element>> {
84+
_lock.lock(); defer { _lock.unlock() }
8585
if _stopped {
86-
return
86+
return Bag()
8787
}
8888

8989
switch event {
@@ -96,6 +96,6 @@ final class ShareReplay1<Element>
9696
_connection = nil
9797
}
9898

99-
_observers.on(event)
99+
return _observers
100100
}
101-
}
101+
}

RxSwift/Observables/Implementations/ShareReplay1WhileConnected.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,22 @@ final class ShareReplay1WhileConnected<Element>
7171
}
7272

7373
func on(event: Event<E>) {
74-
_lock.lock(); defer { _lock.unlock() }
75-
_synchronized_on(event)
74+
_synchronized_on(event).on(event)
7675
}
7776

78-
func _synchronized_on(event: Event<E>) {
77+
func _synchronized_on(event: Event<E>) -> Bag<AnyObserver<Element>> {
78+
_lock.lock(); defer { _lock.unlock() }
7979
switch event {
8080
case .Next(let element):
8181
_element = element
82-
_observers.on(event)
82+
return _observers
8383
case .Error, .Completed:
8484
_element = nil
8585
_connection?.dispose()
8686
_connection = nil
8787
let observers = _observers
8888
_observers = Bag()
89-
observers.on(event)
89+
return observers
9090
}
9191
}
92-
}
92+
}

RxSwift/Subjects/BehaviorSubject.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ public final class BehaviorSubject<Element>
8181
- parameter event: Event to send to the observers.
8282
*/
8383
public func on(event: Event<E>) {
84-
_lock.lock(); defer { _lock.unlock() }
85-
_synchronized_on(event)
84+
_synchronized_on(event).on(event)
8685
}
8786

88-
func _synchronized_on(event: Event<E>) {
87+
func _synchronized_on(event: Event<E>) -> Bag<AnyObserver<Element>> {
88+
_lock.lock(); defer { _lock.unlock() }
8989
if _stoppedEvent != nil || _disposed {
90-
return
90+
return Bag()
9191
}
9292

9393
switch event {
@@ -97,7 +97,7 @@ public final class BehaviorSubject<Element>
9797
_stoppedEvent = event
9898
}
9999

100-
_observers.on(event)
100+
return _observers
101101
}
102102

103103
/**
@@ -158,4 +158,4 @@ public final class BehaviorSubject<Element>
158158
_stoppedEvent = nil
159159
}
160160
}
161-
}
161+
}

RxSwift/Subjects/PublishSubject.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,29 @@ final public class PublishSubject<Element>
5959
- parameter event: Event to send to the observers.
6060
*/
6161
public func on(event: Event<Element>) {
62-
_lock.lock(); defer { _lock.unlock() }
63-
_synchronized_on(event)
62+
_synchronized_on(event).on(event)
6463
}
6564

66-
func _synchronized_on(event: Event<E>) {
65+
func _synchronized_on(event: Event<E>) -> Bag<AnyObserver<Element>> {
66+
_lock.lock(); defer { _lock.unlock() }
67+
6768
switch event {
6869
case .Next(_):
6970
if _disposed || _stopped {
70-
return
71+
return Bag()
7172
}
7273

73-
_observers.on(event)
74+
return _observers
7475
case .Completed, .Error:
7576
if _stoppedEvent == nil {
7677
_stoppedEvent = event
7778
_stopped = true
78-
_observers.on(event)
79+
let observers = _observers
7980
_observers.removeAll()
81+
return observers
8082
}
83+
84+
return Bag()
8185
}
8286
}
8387

@@ -136,4 +140,4 @@ final public class PublishSubject<Element>
136140
_observers.removeAll()
137141
_stoppedEvent = nil
138142
}
139-
}
143+
}

RxSwift/Subjects/ReplaySubject.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,30 @@ class ReplayBufferBase<Element>
105105
}
106106

107107
override func on(event: Event<Element>) {
108-
_lock.lock(); defer { _lock.unlock() }
109-
_synchronized_on(event)
108+
_synchronized_on(event).on(event)
110109
}
111110

112-
func _synchronized_on(event: Event<E>) {
111+
func _synchronized_on(event: Event<E>) -> Bag<AnyObserver<Element>> {
112+
_lock.lock(); defer { _lock.unlock() }
113113
if _disposed {
114-
return
114+
return Bag()
115115
}
116116

117117
if _stoppedEvent != nil {
118-
return
118+
return Bag()
119119
}
120120

121121
switch event {
122122
case .Next(let value):
123123
addValueToBuffer(value)
124124
trim()
125-
_observers.on(event)
125+
return _observers
126126
case .Error, .Completed:
127127
_stoppedEvent = event
128128
trim()
129-
_observers.on(event)
129+
let observers = _observers
130130
_observers.removeAll()
131+
return observers
131132
}
132133
}
133134

@@ -260,4 +261,4 @@ final class ReplayAll<Element> : ReplayManyBase<Element> {
260261
override func trim() {
261262

262263
}
263-
}
264+
}

RxTests.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxTests"
3-
s.version = "2.6.0"
3+
s.version = "2.6.1"
44
s.summary = "RxSwift Testing extensions"
55
s.description = <<-DESC
66
Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers
@@ -55,7 +55,7 @@ func testMap() {
5555

5656
s.framework = 'XCTest'
5757

58-
s.dependency 'RxSwift', '~> 2.5'
58+
s.dependency 'RxSwift', '~> 2.6'
5959

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

RxTests/Info.plist

0 Bytes
Binary file not shown.

Sources/AllTestz/Anomalies.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Tests/RxSwiftTests/Anomalies.swift

0 commit comments

Comments
 (0)