Transforms strong into weak reference for `rx_notification` wrapper.
This commit is contained in:
parent
d387f91afa
commit
26b38e3444
|
|
@ -21,7 +21,7 @@ extension NSNotificationCenter {
|
|||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.uo")
|
||||
public func rx_notification(name: String, object: AnyObject? = nil) -> Observable<NSNotification> {
|
||||
return Observable.create { observer in
|
||||
return Observable.create { [weak object] observer in
|
||||
let nsObserver = self.addObserverForName(name, object: object, queue: nil) { notification in
|
||||
observer.on(.Next(notification))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue