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 types
  • Create 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 ...

Get Learning Xcode 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.