Summary
In this chapter, you completed the implementation of the Add New Journal Entry screen by adding a way for the user to get a photo from the camera or photo library, which then can be added to a new journal entry. First, you added a tap gesture recognizer to the image view in the New Entry scene and configured it to display an image picker controller. Then, you implemented the UIImagePickerDelegate
protocol, which allows you to get a photo from the camera or the photo library, and made the photo smaller before it is saved to the journal entry instance. You also modified the Info.plist
file to allow you to access the camera and photo library.
You are now able to write your own apps that import photos from your camera or photo library.
In the next chapter, you’ll implement a way for the user to search through the journal entries on the Journal List screen.