Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
iOS 10 Programming for Beginners

You're reading from   iOS 10 Programming for Beginners Explore the latest iOS 10 and Swift 3 features

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781786464507
Length 678 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Craig Clayton Craig Clayton
Author Profile Icon Craig Clayton
Craig Clayton
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Getting Familiar with Xcode FREE CHAPTER 2. Building a Foundation with Swift 3. Digging Deeper 4. Digging into Collections 5. Starting the UI Setup 6. Setting Up UI 7. Getting Started with the Grid 8. Getting Started with the List 9. Working More with Lists 10. Where Are We? 11. Where's My Data? 12. Foodie Reviews 13. Saving Reviews 14. Universal 15. iMessages 16. Notifications 17. Just a Peek 18. Beta and Store Submission Index

Creating a data model

The data model is where you create your app's model objects and their properties. For our project, we only need to create one model object, called Review. Let's create a Managed Object Model now:

  1. In the Navigator panel, right-click on the Common folder and create a new group, called Core Data.
  2. Next, right-click this new Core Data folder and click New File.
  3. Inside the Choose a template for your new file screen, select iOS at the top, and then scroll down to the Core Data section and select Data Model. Then, hit Next:
    Creating a data model
  4. Name the file LetsEatModel and click Create.
  5. Click Add Entity in the screen that appears:
    Creating a data model
  6. Then, in the new screen, in the bottom-right corner, change the Editor Style to see the Graph Style:
    Creating a data model
  7. In the Graph Style, double click on Entity in the box in the middle of the graph to change our Entity's name:
    Creating a data model
  8. Update the text to say Review and then hit Enter.

Now that we have our first Entity created, let's add our first attribute:

  1. Select our Review Entity...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image