此func用于显示/呈现ViewController。
let noteViewController = NoteViewController()
extension NoteTableViewController: UIViewControllerTransitioningDelegate {
func remindLater() {
if let note = notificationNote?.copy() as? Note {
noteViewController.transitioningDelegate = self
noteViewController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
noteViewController.modalTransitionStyle = UIModalTransitionStyle.coverVertical
resultSearchController.searchBar.isHidden = true
present(noteViewController, animated: true, completion: nil)
//show(noteViewController, sender: self)
}
}
}
在ViewController上,我试图呈现UIDatePicker对象的插座。在viewdidLoad()
方法上,我有这一行导致错误。
frameDatePicker = remindDatePicker.frame
所以,我发现remindDatePicker和其他对象等于nil。 我应该在哪里找到错误?