Select snippet type
Our next story is "I want to select the type of snippet I am creating". The tasks are:
Append the
SnippetData
model to allow for Text and Photo typesCreate an alert controller that allows the user to select the type of snippet that is created
For this feature, we're going to expand on our SnippetData
model to include the ability to have a type using an enum. Then we're going to create and present an alert controller to the user that allows them to choose a type. Finally, we're going to update our view controller to respond to the different options the user can select, and create the correct type of data.
Update SnippetData model
Current task: Append the SnippetData
model to allow for Text and Photo types.
When we created our SnippetData
model, it was a very simple Swift struct that didn't hold any data. Now we want to add a type property to the struct so that it knows what kind of data it is holding. We're going to create an enum to describe the possible types that can exist...