0

This func is used for showing/presenting 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)
    }
}
}

On the ViewController i am trying to present i've an outlet for UIDatePicker object. On viewdidLoad() method i have this line that causes an error.

frameDatePicker = remindDatePicker.frame

So, i found remindDatePicker and other objects equal to nil. Where should i find a mistake?

L1GhTUA
  • 489
  • 1
  • 3
  • 14
  • This might help - http://stackoverflow.com/questions/29321383/iboutlet-is-nil-but-it-is-connected-in-storyboard-swift - View Controller may not have loaded its hierarchy.. – Marcus Leon Dec 14 '16 at 12:48
  • Since you are instantiating `NoteViewController` with a simple initialiser rather than from a nib/storyboard none of the outlets will be set. – Paulw11 Dec 14 '16 at 13:06

0 Answers0