I am trying to rewrite the following code into Swift 3, can anyone Help?
self.queryDidUpdateObserver = NSNotificationCenter
.defaultCenter()
.addObserverForName(NSMetadataQueryDidUpdateNotification,
object: metadataQuery,
queue: NSOperationQueue.mainQueue()) { (notification) in
self.queryUpdated()
}
self.queryDidFinishGatheringObserver = NSNotificationCenter
.defaultCenter()
.addObserverForName(NSMetadataQueryDidFinishGatheringNotification,
object: metadataQuery,
queue: NSOperationQueue.mainQueue()) { (notification) in
self.queryUpdated()
}