{"id":1275,"date":"2014-10-06T11:10:39","date_gmt":"2014-10-06T17:10:39","guid":{"rendered":"http:\/\/jamesonquave.com\/blog\/?p=1275"},"modified":"2021-05-30T05:02:04","modified_gmt":"2021-05-30T11:02:04","slug":"core-data-in-swift-tutorial-part-1","status":"publish","type":"post","link":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/","title":{"rendered":"Core Data in Swift Tutorial (Part 1)"},"content":{"rendered":"<p><strong>This post compatible with Xcode 6.3 Beta, Updated on February 16, 2015<\/strong><br \/>\n<i>Don&#8217;t have 6.3 yet? Make sure to <a href=\"https:\/\/developer.apple.com\/devcenter\/download.action?path=\/Developer_Tools\/Xcode_6.3_beta\/Xcode_6.3_beta.dmg\">download it here<\/a> using your iOS Developer account.<\/i><\/p>\n<p>Core Data is the de facto standard way to persist and manage data in both iPhone and Mac applications, and with Swift it&#8217;s a bit easier. So it&#8217;s only natural that we should take some time to learn about it when building <span style=\"color: #333333;\"><a style=\"color: #333333;\" href=\"https:\/\/bestarticlesforyou.com\/thoptv-for-windows-pc-download\/\">apps<\/a><\/span>. Eager to see what we&#8217;ll have created by the end of this tutorial? Take a look at the video, we&#8217;ll be creating this table view, populating it with data, adding the ability to delete records, add records, and sort\/search records all backed by Core Data. This data is persistent and lasts even through a complete shut down of your phone.<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/UX4lRZwQlos\" width=\"420\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>The first thing to know about Core Data before diving in is that it is <strong>not<\/strong> a relational database, and although it uses SQLite as a backing engine, is not an ORM to a relational database either. The SQLite backend is more of an implementation detail, and in fact binary files or plists can be used instead.<\/p>\n<p>The official Apple documentation describes Core Data like this:<\/p>\n<p><i>&#8220;The Core Data framework provides generalized and automated solutions to common tasks associated with object life-cycle and object graph management, including persistence.&#8221;<\/i><br \/>\n<a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Conceptual\/CoreData\/Articles\/cdTechnologyOverview.html#\/\/apple_ref\/doc\/uid\/TP40009296-SW1\">[developer.apple.com]<\/a><\/p>\n<p>Before we get too technical about what Core Data is, I think it&#8217;s useful to dive in and start playing with the API a bit.<\/p>\n<p>Create a new Xcode 6 project using a single-view template, Swift as the language, and with Core Data enabled. I&#8217;ll call the project <strong>MyLog<\/strong>.<\/p>\n<div style=\"border: 1px solid #eee; margin: 5px;\"><center><br \/>\n<i>Looking for something more in-depth than a tutorial? Try my book &amp; video courses<\/i><br \/>\n<a href=\"http:\/\/jamesonquave.com\/swiftebook\/\"><img decoding=\"async\" src=\"http:\/\/jamesonquave.com\/swiftebook\/img\/sm-cover.png\" alt=\"Get The Swift Book\" height=\"150\" \/><br \/>\nLearn About My Book &amp; Video Packages \u00bb<\/a><\/center><\/div>\n<p><img decoding=\"async\" src=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/MyLog.png\" \/><\/p>\n<p>Looking at the AppDelegate.swift file you&#8217;ll notice using this option has added quite a few functions. Most of these are setting up the Core Data stack. The defaults are fine for now. The primary object that needs to be used to work with Core Data is the managedObjectContext defined here.<\/p>\n<p><i>If you used the Core Data template as shown above, <strong>this code will already be present<\/strong>.<\/i><\/p>\n<pre class=\"brush: js;\">lazy var managedObjectContext: NSManagedObjectContext? = {\r\n    \/\/ Returns the managed object context for the application (which is already bound to the persistent store\r\n    \/\/ coordinator for the application.) This property is optional since there are legitimate error\r\n    \/\/ conditions that could cause the creation of the context to fail.\r\n    let coordinator = self.persistentStoreCoordinator\r\n    if coordinator == nil {\r\n        return nil\r\n    }\r\n    var managedObjectContext = NSManagedObjectContext()\r\n    managedObjectContext.persistentStoreCoordinator = coordinator\r\n    return managedObjectContext\r\n}()\r\n<\/pre>\n<p>All you really need to know about this, is that managedObjectContext is a lazy variable on AppDelegate that is at our disposable for use in performing Core Data calls. Knowing this we can access the managedObjectContext from our ViewController.swift file. For example in viewDidLoad() of ViewController.swift, we can use this code to print the managedObjectContext&#8217;s description to the console. (New lines are highlighted)<\/p>\n<pre class=\"brush: js;highlight: [5,6,7,8,9];\">override func viewDidLoad() {\r\n    super.viewDidLoad()\r\n    \/\/ Do any additional setup after loading the view, typically from a nib.\r\n    \r\n    \/\/ Retreive the managedObjectContext from AppDelegate\r\n    let managedObjectContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext\r\n    \r\n    \/\/ Print it to the console\r\n    println(managedObjectContext)\r\n}\r\n<\/pre>\n<p>We&#8217;ll be accessing the managedObjectContext pretty frequently, so we should pull this out of the viewDidLoad() method and move it somewhere we can access it easily. How about if we just store it as an instance variable on the ViewController?<\/p>\n<pre class=\"brush: js;highlight: [5,6,12,13];\">import UIKit\r\n\r\nclass ViewController: UIViewController {\r\n    \r\n    \/\/ Retreive the managedObjectContext from AppDelegate\r\n    let managedObjectContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext\r\n\r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        \/\/ Do any additional setup after loading the view, typically from a nib.\r\n        \r\n        \/\/ Print it to the console\r\n        println(managedObjectContext)\r\n    }\r\n\r\n    override func didReceiveMemoryWarning() {\r\n        super.didReceiveMemoryWarning()\r\n        \/\/ Dispose of any resources that can be recreated.\r\n    }\r\n\r\n}\r\n<\/pre>\n<p>The managedObjectContext variable is computed using the existing managedObjectContext in the application&#8217;s delegate. In viewdidLoad() we cause this variable to be computed by printing it to the console. If your application is set up right you should see something like this:<\/p>\n<pre>Optional(&lt;NSManagedObjectContext: 0x7fe68b58c800&gt;)\r\n<\/pre>\n<p>You&#8217;ll notice the Xcode template produced an additional file, MyLog.xcdatamodeld.<\/p>\n<p>Opening up this file you can see the Core Data model editor.<\/p>\n<p>Let&#8217;s add a new Core Data entity called LogItem. Our log app will show a list of LogItems, which have a bit of text in them.<\/p>\n<p>Click the &#8220;Add Entity&#8221; button and then in the right-hand panel select the &#8220;Data Model Inspector&#8221;. From here we can rename the default name, <strong>Entity<\/strong>, to <strong>LogItem<\/strong>.<\/p>\n<p><a href=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/coreDataEditor.png\"><img decoding=\"async\" src=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/coreDataEditor.png\" \/><\/a><\/p>\n<p>Next, at the bottom we can add our first attribute by pressing the &#8220;+ Atrribute&#8221; button at the bottom.<\/p>\n<p>Name this attribute <strong>title<\/strong>, and give it a type of String. We&#8217;ll also add a second attribute of type String called <strong>itemText<\/strong>.<\/p>\n<p><a href=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/attributes.png\"><img decoding=\"async\" src=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/attributes.png\" \/><\/a><\/p>\n<p><strong>IMPORTANT!<\/strong><\/p>\n<p>From this point on, any changes you make to your Core Data model, such as adding a new Entity or Attribute will lead to an inconsistency in the model of the app in the iPhone Simulator. If this happens to you, you&#8217;ll get a really scary looking crash in your app as soon as it starts. You&#8217;ll also see something like this show up at the very bottom of your console, &#8220;reason=The model used to open the store is incompatible with the one used to create the store&#8221;.<\/p>\n<p>If this happens to you there is a very easy fix:<br \/>\nIn the iPhone Simulator, or on your device, just delete the app, and then perform a new Build &amp; Run command in Xcode. This will erase all out of date versions of the model, and allow you to do a fresh run.<\/p>\n<p>&nbsp;<\/p>\n<p>Now that we have our first Entity created, we want to also be able to directly access this entity as a class in our code. Xcode provides an automated tool to do this. In the menubar select <strong>Editor-&gt;Create NSManagedObject Subclass&#8230;<\/strong><\/p>\n<p>In the first prompt, check the MyLog model and press next. Then, check the LogItem entity, and press next again.<br \/>\nA file save window should appear with an option to specify the language as <strong>Swift<\/strong>, select this. Finally hit Create, and you should now see a LogItem.swift file added. It&#8217;s contents should be something very close to this:<\/p>\n<pre class=\"brush: js;\">import Foundation\r\nimport CoreData\r\n\r\nclass LogItem: NSManagedObject {\r\n    @NSManaged var title: String\r\n    @NSManaged var itemText: String\r\n}\r\n<\/pre>\n<p>This class is generated from the xcdatamodeld file. The entity we created is represented by the similarly named class LogItem, and the attributes are turned in to variables using the @NSManaged identifier, which gives the variables special treatment allowing them to operate with Core Data. For most intents and purposes though, you can just think of these as instance variables.<\/p>\n<p>Because of the way Swift modules work, we need to make one modification to the core data model. In the field &#8220;Class&#8221; under the data model inspector for our entity, LogItem, we need to specify the project name as a prefix to the class name. So instead of just specifying &#8220;LogItem&#8221; as the class, it needs to say &#8220;MyLog.LogItem&#8221;, assuming your app is called &#8220;MyLog&#8221;.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jamesonquave.com\/blog\/wp-content\/uploads\/logItemCD.png\" \/><\/p>\n<p>In our ViewController.swift file in the viewDidLoad method, let&#8217;s instantiate some instances of LogItem. There are many ways to do this, but the least verbose is to use the insertNewObjectForEntityForName method of NSEntityDescription.<\/p>\n<pre class=\"brush: js;\">override func viewDidLoad() {\r\n    super.viewDidLoad()\r\n\r\n    let newItem = NSEntityDescription.insertNewObjectForEntityForName(\"LogItem\", inManagedObjectContext: self.managedObjectContext!) as! LogItem\r\n}\r\n<\/pre>\n<p>Here we insert a new object in to the core data stack through the managedObjectContext that the template function added to AppDelegate for us. This method returns an NSManagedObject which is a generic type of Core Data object that responds to methods like <strong>valueForKey<\/strong>. If you don&#8217;t quite understand what that means, don&#8217;t worry too much about it, it&#8217;s not going to prevent you from being able to use Core Data. Let&#8217;s keep moving.<\/p>\n<p>With an NSManagedObject version of newItem, we could say newItem.valueForKey(&#8220;title&#8221;) to get the title. But this is not the best approach because it leaves too much opportunity to mis-type an attribute name, or get the wrong object type unexpectedly and have hard crashes trying to access these attributes.<\/p>\n<p>So, in our case, we instead cast the NSManagedObject that insertNewObjectForEntityForName returns, to our generated class <strong>LogItem<\/strong>.<\/p>\n<p>What this means, simply put, is that we can set the title and itemText like this:<\/p>\n<pre class=\"brush: js;\">override func viewDidLoad() {\r\n    super.viewDidLoad()\r\n    \/\/ Do any additional setup after loading the view, typically from a nib.\r\n    \r\n    let newItem = NSEntityDescription.insertNewObjectForEntityForName(\"LogItem\", inManagedObjectContext: self.managedObjectContext!) as! LogItem\r\n\r\n    newItem.title = \"Wrote Core Data Tutorial\"\r\n    newItem.itemText = \"Wrote and post a tutorial on the basics of Core Data to blog.\"\r\n}\r\n<\/pre>\n<p>If we had not generated our LogItem.swift file earlier, the type <strong>LogItem<\/strong> would not be defined and we would be limited to working only with NSManagedObject types. This is a really nasty way to work with the Core Data API as it relies heavily on determining object classes, entities, state, and more at runtime based on string comparisons, yuck!<\/p>\n<p>Now that we&#8217;ve created a new item, and set both it&#8217;s title and text, we can query it elsewhere in our app and get the object back. Let&#8217;s override the viewDidAppear() method and implement a way to look at our items info. We&#8217;ll perform a Core Data fetch (which is like a query if you have worked with SQL before), then we will present the contents of the row we retrieved in a new alert window.<\/p>\n<pre class=\"brush: js;\">override func viewDidAppear(animated: Bool) {\r\n    super.viewDidAppear(animated)\r\n    \r\n    \/\/ Create a new fetch request using the LogItem entity\r\n    let fetchRequest = NSFetchRequest(entityName: \"LogItem\")\r\n    \r\n    \/\/ Execute the fetch request, and cast the results to an array of LogItem objects\r\n    if let fetchResults = managedObjectContext!.executeFetchRequest(fetchRequest, error: nil) as? [LogItem] {\r\n        \r\n        \/\/ Create an Alert, and set it's message to whatever the itemText is\r\n        let alert = UIAlertController(title: fetchResults[0].title,\r\n            message: fetchResults[0].itemText,\r\n            preferredStyle: .Alert)\r\n        \r\n        \/\/ Display the alert\r\n        self.presentViewController(alert,\r\n            animated: true,\r\n            completion: nil)\r\n    }\r\n}\r\n<\/pre>\n<p>First, we create a new NSFetchRequest instance using the entity LogItem.<br \/>\nNext, we create a fetchResults variable by using the executeFetchRequest method of managedObjectContext. The only thing we have specified in our fetchRequest is the entity, so this particular fetch just returns every record. If you are familiar with SQL, a fetch request with no predicate on the LogItem entity is something like <i>&#8220;SELECT * FROM LogItem&#8221;<\/i>.<br \/>\nNext we create a UIAlertController instance to present a message to the screen, and set it&#8217;s title and message properties to the title and itemText properties of the first LogItem in our fetch results (which is an array of LogItem objects).<\/p>\n<p>Run the app and you should see the item presented to the screen. You&#8217;ve now stored and retrieved data from Core Data. This is the first step in to building apps with persistent storage.<\/p>\n<p>In <a href=\"http:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-2\/\">part 2<\/a>, we&#8217;ll talk about working with multiple records and using NSPredicate to perform filtered requests.<\/p>\n<p>The full source code to this part is <a href=\"https:\/\/github.com\/jquave\/Core-Data-In-Swift-Tutorial\/tree\/Part1\">available here on Github<\/a>.<\/p>\n<div class=\"tut-toc\"><a class=\"tutorial-part-button current\" href=\"http:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\">Part 1<\/a><br \/>\n<a class=\"tutorial-part-button\" href=\"http:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-2\/\">Part 2<\/a><br \/>\n<a class=\"tutorial-part-button\" href=\"http:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-3\/\">Part 3<\/a><br \/>\n<a class=\"tutorial-part-button\" href=\"http:\/\/jamesonquave.com\/blog\/core-data-migrations-swift-tutorial\/\">Part 4<\/a><\/div>\n<p>If you found this post useful, check out <a href=\"http:\/\/jamesonquave.com\/blog\/tutorials\/\">my other tutorials<\/a>, and take a look at my <a href=\"http:\/\/jamesonquave.com\/swifebook\">Swift eBook<\/a>, which is now available for early access.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post compatible with Xcode 6.3 Beta, Updated on February 16, 2015 Don&#8217;t have 6.3 yet? Make sure to download it here using your iOS Developer account. Core Data is the de facto standard way to persist and manage data in both iPhone and Mac applications, and with Swift it&#8217;s a bit easier. So it&#8217;s&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_links_to":"","_links_to_target":""},"categories":[21,25,7,10,32],"tags":[61,15,62,34,33],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Core Data in Swift Tutorial (Part 1) - Jameson Quave<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Core Data in Swift Tutorial (Part 1) - Jameson Quave\" \/>\n<meta property=\"og:description\" content=\"This post compatible with Xcode 6.3 Beta, Updated on February 16, 2015 Don&#8217;t have 6.3 yet? Make sure to download it here using your iOS Developer account. Core Data is the de facto standard way to persist and manage data in both iPhone and Mac applications, and with Swift it&#8217;s a bit easier. So it&#8217;s...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Jameson Quave\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-06T17:10:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-30T11:02:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jamesonquave.com\/swiftebook\/img\/sm-cover.png\" \/>\n<meta name=\"author\" content=\"Jameson Quave\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jameson Quave\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\",\"url\":\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\",\"name\":\"Core Data in Swift Tutorial (Part 1) - Jameson Quave\",\"isPartOf\":{\"@id\":\"https:\/\/jamesonquave.com\/blog\/#website\"},\"datePublished\":\"2014-10-06T17:10:39+00:00\",\"dateModified\":\"2021-05-30T11:02:04+00:00\",\"author\":{\"@id\":\"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/db6184f355c7f4e3b876d0f228c2fcfc\"},\"breadcrumb\":{\"@id\":\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jamesonquave.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Core Data in Swift Tutorial (Part 1)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jamesonquave.com\/blog\/#website\",\"url\":\"https:\/\/jamesonquave.com\/blog\/\",\"name\":\"Jameson Quave\",\"description\":\"Using computer technology to educate, and improve lives.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jamesonquave.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/db6184f355c7f4e3b876d0f228c2fcfc\",\"name\":\"Jameson Quave\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d9786c83345117d560bbeab0e1f26814?s=96&d=retro&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d9786c83345117d560bbeab0e1f26814?s=96&d=retro&r=pg\",\"caption\":\"Jameson Quave\"},\"sameAs\":[\"http:\/\/jamesonquave.com\"],\"url\":\"https:\/\/jamesonquave.com\/blog\/author\/jquave\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Core Data in Swift Tutorial (Part 1) - Jameson Quave","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/","og_locale":"en_US","og_type":"article","og_title":"Core Data in Swift Tutorial (Part 1) - Jameson Quave","og_description":"This post compatible with Xcode 6.3 Beta, Updated on February 16, 2015 Don&#8217;t have 6.3 yet? Make sure to download it here using your iOS Developer account. Core Data is the de facto standard way to persist and manage data in both iPhone and Mac applications, and with Swift it&#8217;s a bit easier. So it&#8217;s...","og_url":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/","og_site_name":"Jameson Quave","article_published_time":"2014-10-06T17:10:39+00:00","article_modified_time":"2021-05-30T11:02:04+00:00","og_image":[{"url":"http:\/\/jamesonquave.com\/swiftebook\/img\/sm-cover.png"}],"author":"Jameson Quave","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jameson Quave","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/","url":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/","name":"Core Data in Swift Tutorial (Part 1) - Jameson Quave","isPartOf":{"@id":"https:\/\/jamesonquave.com\/blog\/#website"},"datePublished":"2014-10-06T17:10:39+00:00","dateModified":"2021-05-30T11:02:04+00:00","author":{"@id":"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/db6184f355c7f4e3b876d0f228c2fcfc"},"breadcrumb":{"@id":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jamesonquave.com\/blog\/core-data-in-swift-tutorial-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jamesonquave.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Core Data in Swift Tutorial (Part 1)"}]},{"@type":"WebSite","@id":"https:\/\/jamesonquave.com\/blog\/#website","url":"https:\/\/jamesonquave.com\/blog\/","name":"Jameson Quave","description":"Using computer technology to educate, and improve lives.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jamesonquave.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/db6184f355c7f4e3b876d0f228c2fcfc","name":"Jameson Quave","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jamesonquave.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d9786c83345117d560bbeab0e1f26814?s=96&d=retro&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d9786c83345117d560bbeab0e1f26814?s=96&d=retro&r=pg","caption":"Jameson Quave"},"sameAs":["http:\/\/jamesonquave.com"],"url":"https:\/\/jamesonquave.com\/blog\/author\/jquave\/"}]}},"_links":{"self":[{"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/posts\/1275"}],"collection":[{"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/comments?post=1275"}],"version-history":[{"count":59,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions"}],"predecessor-version":[{"id":2702,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions\/2702"}],"wp:attachment":[{"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/media?parent=1275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/categories?post=1275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jamesonquave.com\/blog\/wp-json\/wp\/v2\/tags?post=1275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}