Transforms strong into weak reference for `rx_notification` wrapper.

This commit is contained in:
Krunoslav Zaher 2015-12-24 19:50:22 +01:00
parent d387f91afa
commit 26b38e3444
1 changed files with 1 additions and 1 deletions

View File

@ -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))
}