PhotoSnippet implementation
Now that we've added text snippets, let's allow the user to create photo snippets. This user story says "I want to attach a photo to a snippet". The associated tasks are:
Create a new subclass of
SnippetDatathat represents thePhotoSnippetCreate a new view controller with a
UIImagePickerControllerthat allows the user to take a picture and save the data to thePhotoSnippet.
Just like our last story, we're first going to update our data model to support the new snippet we are creating. Then we're going to build another data entry view controller, but this time it will let the user take a picture. Don't worry, though; it might be easier than you think.
Update SnippetData model
Current task: Create a new subclass of SnippetData that represents the PhotoSnippet.
For our photo snippet, we'll be creating another subclass of the SnippetData class. However, instead of holding a String property, it's going to hold a UIImage. To start, head over to our SnippetData.swift file...