Hi all,
I am having a problem with cancel/done buttons in the Add Checklist scene, in the ListDetailViewController.swift source file.
@IBAction func cancel() {
print("before")
delegate?.listDetailViewControllerDidCancel(self)
print("after")
}
@IBAction func done() {
if let checklist = checklistToEdit {
checklist.name = textField.text!
delegate?.listDetailViewController(self, didFinishEditing: checklist)
} else {
let checklist = Checklist(name: textField.text!)
delegate?.listDetailViewController(self,didFinishAdding: checklist)
}
}
Basically they do work, when I click on “cancel” it does not return to the “AllList” scene.
Question 1) Why in the “ItemDetail…swift” the same action contain this code?
navigationController?.popViewController(animated: true )
If I put the same in the ListDetail…swift, then it works
What am I missing?
Thanks
Marco