Skip to content

Commit 6fbec1b

Browse files
author
Rafael da Silva Ferreira
committed
Make rx.disposeBag public
To allow us use it into a UIViewController for example.
1 parent c670eba commit 6fbec1b

6 files changed

Lines changed: 25 additions & 8 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
osx_image: xcode8.2
1+
osx_image: xcode8.3
22
language: objective-c
33
podfile: Demo/Podfile
44
cache: cocoapods

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
);
258258
runOnlyForDeploymentPostprocessing = 0;
259259
shellPath = /bin/sh;
260-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
260+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
261261
showEnvVarsInLog = 0;
262262
};
263263
9FB93DCD00D21C3B467F9BEF /* [CP] Copy Pods Resources */ = {
@@ -302,7 +302,7 @@
302302
);
303303
runOnlyForDeploymentPostprocessing = 0;
304304
shellPath = /bin/sh;
305-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
305+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
306306
showEnvVarsInLog = 0;
307307
};
308308
FFDE61183A484AA609E96F39 /* [CP] Embed Pods Frameworks */ = {

Demo/DemoTests/DemoTests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,22 @@ class Test: QuickSpec {
2929
variable.onNext(1)
3030
expect(executed) == false
3131
}
32+
33+
it("disposes using rx.disposeBag") {
34+
var executed = false
35+
let variable = PublishSubject<Int>()
36+
37+
do {
38+
let subject = NSObject()
39+
40+
variable.subscribe(onNext: { _ in
41+
executed = true
42+
}).addDisposableTo(subject.rx.disposeBag)
43+
}
44+
45+
variable.onNext(1)
46+
47+
expect(executed) == false
48+
}
3249
}
3350
}

Demo/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Nimble (6.1.0)
3-
- NSObject+Rx (2.0.0):
3+
- NSObject+Rx (2.2.0):
44
- RxSwift
55
- Quick (1.1.0)
66
- RxSwift (3.0.1)
@@ -17,10 +17,10 @@ EXTERNAL SOURCES:
1717

1818
SPEC CHECKSUMS:
1919
Nimble: c53e6903fee94041b90ded74f135820437d8bf59
20-
NSObject+Rx: 2a9cd801d9c847e6d2486cbad8d7701b67834e70
20+
NSObject+Rx: be98a305d3c488a7b8da6fc38c0c64aba70514cf
2121
Quick: dafc587e21eed9f4cab3249b9f9015b0b7a7f71d
2222
RxSwift: af5680055c4ad04480189c52d28385b1029493a6
2323

2424
PODFILE CHECKSUM: 0505237e77e025183988e56cdaa4bb98c27d03ba
2525

26-
COCOAPODS: 1.2.0
26+
COCOAPODS: 1.2.1

NSObject+Rx.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 = "NSObject+Rx"
3-
s.version = "2.1.0"
3+
s.version = "2.2.0"
44
s.summary = "Handy RxSwift extensions on NSObject."
55
s.description = <<-DESC
66
Right now, we just have a `rx_disposeBag` property, but we're open to PRs!

NSObject+Rx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public extension NSObject {
3636
}
3737
}
3838

39-
extension Reactive where Base: NSObject {
39+
public extension Reactive where Base: NSObject {
4040
var disposeBag: DisposeBag {
4141
return base.rx_disposeBag
4242
}

0 commit comments

Comments
 (0)