i think there is a little error in the third alternative if-statement on page 117.
The code in the body should not be “return”, but “descriptionTextView.resignFirstResponder()”:
if let indexPath = indexPath, indexPath.section != 0 &&
indexPath.row != 0 {
description.TextView.resignFirstResponder()
}
Here is the original snippet from the book page 117:
if let indexPath = indexPath, indexPath.section != 0 && indexPath.row != 0 {
return
}
descriptionTextView.resignFirstResponder()
Maybe I’m totally wrong, but for me it says: If indexPath doesn’t refer to the first cell in the first section (so the user tapped outside the descriptionTextView and cell) return and do nothing.
But when the user tapped outside the descriptionTextView resignFirstResponder() should be called to hide the keyboard …