This project includes solutions to the challenges.
- Disallow answers that are shorter than three letters or are just our start word. For the three-letter check, the easiest thing to do is put a check into
isReal()
that returns false if the word length is under three letters. For the second part, just compare the start word against their input word and return false if they are the same. - Refactor all the
else
statements we just added so that they call a new method calledshowErrorMessage()
. This should accept an error message and a title, and do all theUIAlertController
work from there. - Add a left bar button item that calls
startGame()
, so users can restart with a new word whenever they want to.