I am using the Swift 3.0 version and Xcode 8 for Checklists, and am getting this error for the else statement in this method:
@IBAction func done() {
let item = ChecklistItem()
item.text = textField.text!
item.checked = false
delegate?.addItemViewController(self, didFinishEditing: item)
} else {
let item = ChecklistItem()
item.text = textField.text!
item.checked = false
delegate?.addItemViewController(self, didFinishAdding: item)
}
}
I have checked for typos, but can’t find anything. Thank you in advance.