Commit d415a86f authored by Aral Balkan's avatar Aral Balkan
Browse files
parent dd2e541c
......@@ -33,7 +33,7 @@ public class NotificationHandler:NSObject
{
var handler:NotificationBlock
init(handler:NotificationBlock)
init(handler:@escaping NotificationBlock)
{
self.handler = handler
}
......@@ -69,7 +69,7 @@ public class NotificationHandler:NSObject
//
public func handle(_ notificationName:String, with block:NotificationBlock) -> NotificationHandler
public func handle(_ notificationName:String, with block:@escaping NotificationBlock) -> NotificationHandler
{
//
// Instead of using the block-based methods of NSNotificationCenter, create an observer
......@@ -81,7 +81,7 @@ public func handle(_ notificationName:String, with block:NotificationBlock) -> N
}
public func handle(_ notificationName:String, from object:Any?, with block:NotificationBlock) -> NotificationHandler
public func handle(_ notificationName:String, from object:Any?, with block:@escaping NotificationBlock) -> NotificationHandler
{
let observer = NotificationHandler(handler: block)
📡.addObserver(observer, selector: #selector(observer.handlerProxy(_:)), name: NSNotification.Name(rawValue: notificationName), object: object)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment