Currently, if you tap the Add Review button, you will see our review form modal. However, currently, you can not dismiss this view. As we have done before, we need to add code that allows us to unwind (dismiss) a View Controller:
- Open the RestaurantDetailsViewController.swift file and add the following into the private extension:
@IBAction func unwindReviewCancel(segue:UIStoryboardSegue) {}
- Save the file and open the ReviewForm.storyboard.
- Use control and drag the Cancel button to the exit icon inside of the same View Controller:
- In the screen that appears, under Action Segue, select unwindReviewCancelWithSegue.
If you build and run the project by hitting the Play button (or use command + R), you should now be able to dismiss the Review Form.