📅  最后修改于: 2022-03-11 15:00:59.944000             🧑  作者: Mango
let nc = NSNotificationCenter.defaultCenter()
nc.addObserver(self, selector: #selector(printValue), name: "printValue", object: nil)
func printValue(notification:NSNotification) {
let userInfo:Dictionary = notification.userInfo as! Dictionary
let item = userInfo["value"]! as String
print(item,self)
}