WIP: segfault

This commit is contained in:
John Rommel Estropia
2016-07-20 08:12:04 +09:00
parent f486ace437
commit 267c21063a
129 changed files with 2205 additions and 3282 deletions

View File

@@ -36,23 +36,23 @@ internal final class NotificationObserver {
let object: AnyObject?
let observer: NSObjectProtocol
init(notificationName: String, object: AnyObject?, queue: NSOperationQueue? = nil, closure: (note: NSNotification) -> Void) {
init(notificationName: String, object: AnyObject?, queue: OperationQueue? = nil, closure: (note: Notification) -> Void) {
self.notificationName = notificationName
self.object = object
self.observer = NSNotificationCenter.defaultCenter().addObserverForName(
notificationName,
self.observer = NotificationCenter.default.addObserver(
forName: NSNotification.Name(rawValue: notificationName),
object: object,
queue: queue,
usingBlock: closure
using: closure
)
}
deinit {
NSNotificationCenter.defaultCenter().removeObserver(
NotificationCenter.default.removeObserver(
self.observer,
name: self.notificationName,
name: NSNotification.Name(rawValue: self.notificationName),
object: self.object
)
}