Errors with .text on page 102

I am working through iOS Apprentice 2 and have run into an error with the delegate code on page 102 - line 3 of the following:

@IBAction func done() {
        let item = ChecklistItem()
        item.text = textField.text!
        item.checked = false
        delegate?addItemViewController(self, didFinishAddingItem: item)

Xcode complains with the following:

‘text’ is unavailable: APIs deprecated as of iOS 7 and earlier are unavailable in Swift

For some reason .text isn’t accepted and I can’t move forward.

Any suggestions?


Are you sure the textField property is a UITextField?

Excellent. That indeed was the unexpected problem. I thought I was doing a good job of typing things in word for word. It was either fat fingers or hitting the autofill wrong that was the problem. Got it working now.