这是我正在使用的代码,我正在尝试按照教程进行操作,但我不知道为什么该按钮在模拟器上不起作用。如果有人能解释它为什么这样做,那将非常有帮助!
@IBAction func didTapAddButton(){
let vc = storyboard?.instantiateViewController(identifier: "date_picker") as! DateViewController
vc.title = "New Event"
vc.completionHandler = { [weak self] name, date in
DispatchQueue.main.async {
didCreateEvent(name: name, targetDate: date)
}
self?.navigationController?.pushViewController(vc, animated: true)
}