Skip to content

Commit

Permalink
Expose bag on NSObject reactive extensions for backwards compatib…
Browse files Browse the repository at this point in the history
…ility.
  • Loading branch information
srdanrasic committed Mar 18, 2017
1 parent 0210386 commit 28d5e43
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ReactiveKit.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = "ReactiveKit"
s.version = "3.4.1"
s.version = "3.4.2"
s.summary = "A Swift Reactive Programming Framework"
s.description = "ReactiveKit is a Swift framework for reactive and functional reactive programming."
s.homepage = "https://github.com/ReactiveKit/ReactiveKit"
s.license = 'MIT'
s.author = { "Srdan Rasic" => "[email protected]" }
s.source = { :git => "https://github.com/ReactiveKit/ReactiveKit.git", :tag => "v3.4.1" }
s.source = { :git => "https://github.com/ReactiveKit/ReactiveKit.git", :tag => "v3.4.2" }

s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
Expand Down
2 changes: 1 addition & 1 deletion ReactiveKit/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>3.4.1</string>
<string>3.4.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
1 change: 1 addition & 0 deletions Sources/Deallocatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extension DisposeBagProvider {
static var DisposeBagKey = "DisposeBagKey"
}

/// A `DisposeBag` that can be used to dispose observations and bindings.
public var bag: DisposeBag {
if let disposeBag = objc_getAssociatedObject(self, &NSObject.AssociatedKeys.DisposeBagKey) {
return disposeBag as! DisposeBag
Expand Down
5 changes: 5 additions & 0 deletions Sources/Reactive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ extension NSObject: ReactiveExtensionsProvider {}
public var deallocated: SafeSignal<Void> {
return base.bag.deallocated
}

/// A `DisposeBag` that can be used to dispose observations and bindings.
public var bag: DisposeBag {
return base.bag
}
}

#endif

0 comments on commit 28d5e43

Please sign in to comment.