==========================
//class TasksCell
func push(){
let sizeString = "123132312"
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "checkDetail"), object: self, userInfo: ["key": sizeString])
}
==========================
//class TasksViewController
override func viewDidLoad() {
super.viewDidLoad()
setupTableVie()
setRefresh()
setupNavBar()
NotificationCenter.default.addObserver(self, selector: #selector(checkDetail(notification:)), name: NSNotification.Name(rawValue: "checkDetail"), object: nil)
}
/// 点击了加号按钮
@objc func checkDetail(notification: Notification) {
let titles = notification.userInfo!["key"] as! NSString
print(titles)
}
deinit {
NotificationCenter.default.removeObserver(self)
}