CWC Stream: Core Data Basics in SwiftUI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
at least i'd like to think that hey everyone how's it going can you hear me so my audio should be louder now in my last five or six streams i apologize i thought you know in this stream labs thing that when the mic is at the green section that's good but actually once i read up on it over the weekend it should kind of be in the yellow section so you'll get uh you get better audio because a lot of people were complaining that the audio was too soft and then half of everyone in here was saying the audio was fine and i think that for the people where the audio was fine they were wearing headphones uh but yeah for the people who thought the audio was too soft they were probably trying to play the audio through the speakers and then when i watched the replay i did notice that my audio was a too soft for the computer speakers so hopefully everything is good now hopefully everyone can hear me the background music isn't too loud and today we are still on the old mac so we are going to do some some core data demonstrations hopefully because i am streaming in 1080p right now when i build the project if you see a little bit of buffering don't leave the stream it's just going to be like three seconds and the new m1 mac mini is coming in i think it's friday i'm also waiting for a monitor for that as well and then hopefully next tuesday when we stream again i'll be able to do some build with me stuff and i'll be able to stream in 1080p and build the xcode projects with no buffering how are you guys all doing is everyone good we'll just give maybe a minute or two before we get started before we dive into the core data stuff because i do want to give a chance for a couple more people to join just in case anyone's running late did you all have a great weekend here in i live in a suburb of ontario in canada and the weather was really great and uh our covet cases are are going down so that's great hello hey andrew hey mark hey jay oh mark your laptop your laptop with beta stuff died oh man and we were just talking about before in a past stream about how sturdy these apple machines are so i guess if it's an old laptop it won't be under applecare unfortunately all right well let's get started because i think that's it's about enough time so before we dive in i don't want to be preaching to the choir so how many of you guys right here in the stream right now have worked with core data and you already know everything i'm going to talk about because i'm just going to be covering the basics in this in this stream if everyone knows core data i'm not going to go through it today but if if it's relatively new for a lot of people i'll go through it 2015 mark yeah this this imac which i'm on right now is 2015. so hopefully it doesn't die no okay seems like it seems like people are interested in this topic and the reason why i decided to cover core data today is because in my databases course let me just show you this on the screen i am working on the core data module so this stuff is you know kind of fresh in my head and we're just about finishing up this material for this databases course and so i thought i'd show you guys this actually this is a good slide to start with so let me full screen the slide from from this lesson right here yeah and you know what i'm actually going to hide the chat box on the screen just so you can see more of it and just in case i want to use this as a replay as a tutorial okay so i think the first thing to keep in mind when using core data is you know everyone talks about it being a database and it's compared to other local database solutions and things like that but at the end of the day uh what apple calls it is an object persistence graph or sorry object graph persistence framework so an object graph is nothing more than the objects that you create in memory when you are you know coding your app and you're making things work and you're creating instances of your classes and your structures uh and then oftentimes they have relationships to each other like one object might hold a reference to another one and so those would be your relationships and that's what i'm demonstrating here with the yellow lines and these cubes are your instances of classes and objects and stuff like that so rather than having to explicitly say you know save this row of data if anyone is used to using traditional databases like mysql uh you know where or or um ms sql server where you are you know working with tables which have columns and rows and stuff like that and you're used to storing your data in rows right this is not like that you're essentially taking what you have in memory at that moment and you can persist it you can save it to local storage and under the hood it's using sqlite however all of that is abstracted from you you just work with the core data api and it's actually very simple to to save data into it and to retrieve it using fetch requests especially with swift ui core data in a swift ui project it's just like working with an array as you'll soon see so what i wanted to point out in this particular diagram is that okay is that there there are a couple of components that i will be mentioning as we work through this core data demo and it's important to keep in mind how these things relate to each other so your core data persistent container down here is kind of like your data store think of this as your database if you want um but you don't interact directly with that and you don't say hey persistent container save my objects or load my objects instead you get this managed object context from the container and it's just a property as you'll see and see and it's through this managed object context that you call those methods to create a brand new object to save or to you know fetch a certain type of object from your core data store so it's this managed object context all right so that's all i wanted to show in this diagram so we can get rid of this for now we can just jump into xcode but let me just check quickly see if you guys have any questions before we move on hi nadia hi from brussels it's awesome to see people from everywhere in the world australia france awesome [Music] hey kamal akar personally teaches swift ui and swift including xcode well there are tons of resources out there you know what i was planning to do more streams in in sort of like teaching style like i'm doing now for core data so i will cover swift and swift ui and xcode as well for the more beginner audience who are just getting started and i'll schedule those so that you can join those and i think that's probably as close as you know personal coaching or tutoring as you're going to get from from code with chris right now uh stefan is there a difference between core data and combine yeah i think they're completely different things so mark moykins is in the chat right now he can talk more about combined and he has some great resources for it but combine is all about building pipelines from data sources to your views and how that process gets managed and transformed so whereas core data is more of like storing data or persisting data across app sessions so if the user is using the app and you know they do something in your app when they close the app maybe they restart the phone maybe they completely quit the app when they launch it for the next session to use your app that some of that data from the first session gets retained and you can sort of resume where you left off that's one scenario you could do all right so first of all let's create a brand new xcode project and let's dive right into core data so you guys have probably noticed when you create new ios apps that there is a checkbox here that says use core data now when you enable this and you check this it's actually going to create a lot of boilerplate and starter code for you in your project that you might not necessarily want in this case we will check it off because i think that's probably the most natural way you'll use it but you can also add the core data components or elements that you need to work with it to an existing xcode project so don't think that just because you didn't enable this when you started the project that you can't add it after the fact however in this case we will start it and i'll probably get rid of a bunch of the code that it starts us off with yeah mark user defaults is great for a lot of things so if for those of you who are unaware user defaults is a great way to just quickly write data and persist data across app sessions it's not meant for sensitive information so you won't be storing passwords or anything like that and not large amounts of data either but um if you want to just preserve like screen state or progress through like a quiz or something or scores user defaults as more than sufficient core data i think you would use for more heavier sets of data okay so let's let's start this project i'm just going to call it core data demo make sure the interface is swift ui lifecycle swift ui and language is swift and use core data is enabled and we'll walk through a couple of the components that it creates for you so i'm just going to create this on my desktop right now oh i already have one i'm gonna get rid of the one on my desktop i don't remember when i created that core data demo on my desktop but i must have must have been testing something before okay so let's try to create this again on my desktop all right so here we are okay so i'm just going to make sure i enlarge this a little bit and maybe i'll make the font a little bigger as well i just don't want to cover anything maybe i'll move [Music] oh you guys see all my messy desktop i'm hiding it behind my face um yeah you know what that's fine okay so let me just make this a little larger what is it themes okay hopefully that's easier to see for everyone unfortunately on the file navigator here yeah file navigator here the font is still a little bit small okay so the most important file for you to start working in is this core data demo dot xc data model id or ld not exactly sure i think it's ld but essentially this is where you're going to define all of your entities and attributes for those entities it's almost like you are defining your tables in a traditional database you're you're defining the things that you want to store inside core data so by default they start you off with one entity it's called item this might be a little hard to see because it didn't enlarge this font but i'm going to go ahead and delete this item and that's actually going to cause a lot of errors in this case because they have a lot of starter code that they started us off with that use items here so you know i'm gonna have to rip out a lot of this code that's kind of the drawback of um of starting off with the core data enabled it actually starts you off with a whole bunch of code that you might not necessarily want so for the i think it's more clear if i get rid of everything and then show you guys from scratch because that way okay so now that's more clean in our content view we just have hello world and then also in persistence here we can actually i'm going to comment out the preview and also in here this persistence controller this preview property and comment that out and just show you guys the bare essentials okay so let's come back to this data model file this is where you're going to define the objects or entities that you want to store inside core data so for this app let's assume that maybe we are a store and we have items to sell so i am going to well item item actually makes sense in this context doesn't it huh let's call it product because i do want to show you guys from the ground up so i'm going to delete this item entity completely so start with an empty model file and we're going to click on add entity and it just creates a brand new one for you so i'm going to call this actually product like a product in our store and let's define some attributes for the product so an easy one would be name for example so what's the data type for this attribute of product well name would probably be string and another one would be price so i'm just going to start with two simple ones as you can see there are different data types here so there's different forms of in in 16 3264. on most modern architectures now it probably should be 64. but i mean most of this is handled under the hood for you or anyways uh decimal double float string boolean date binary data so binary data would be good for storing like image data for example you could store that inside core data uuid that's probably a good one to have actually and transformable would be what you would use for a raise so let's say that we have another one called skew uh have a let's just call it barcodes and i wanted to make this an array of strings to represent the barcodes for this product i would choose transformable and then here in the attribute selector you can specify a custom class for that attribute and here i can specify that it's a custom class of a string array right there and we'll also add an id and we'll make this a uuid hey flo welcome yeah i'll make it available as a replay as well merrell welcome danny welcome uh yes danny you're gonna have to have xcode installed to follow along but if you haven't um if you haven't used xcode before this the topic of today's session might be a little bit uh advanced so keep an eye out for future sessions where i will be going more of the basics through the basics i mean of uh swift and xcode and things like that those are probably the sessions that will be of more value to you okay so continuing on here let's just start with one entity because that's probably the the most simple scenario the next thing we do now that we've defined what we want to save into core data we have to generate a class like a code definition from this um data model file to be used inside our project and there are several options to do that on the right hand side if you highlight your entity you'll see under code gen it says class definition and there's manual and there's also category extension let's go ahead and choose manual first meaning that we as the developer we are going to manually turn this data model file into a class and it sounds more complicated than it actually is because all it is is a command up here so if you go to editor and you go to create ns managed object subclass you just choose your data model you choose your entity which is product so what we've defined and you just choose a place to save it and they'll generate it for you so let's see what happens now at the top it's generated two different files the first one is a class with the same entity name and notice that it subclasses ns managed object now this provides all of that under the hood stuff to allow it to be serialized and deserialized to and from core data which essentially just means it provides the inner workings for it to be saved into core data and to be restored back into an object of a product or an instance of product now what's the second file that it generates well it's an extension of product which essentially means that it's additional um class definition for the product class and you'll see here by default it it gives you a fetch request which we will talk about a little later on but what's interesting is down here these are all of the attributes which we specified for this entity notice however it made most of this optional now by default if we go back to the data model and we check out these attributes by default they are optional right here so if you don't want them to be optional you can uncheck them for any attributes that you don't want to be optional however there is a bug where even if you uncheck them and you don't want them to be optional when you generate them they'll still be optional so that's not ideal however um it's just something you have to be aware of okay so last but not least there's another extension of product which uh conforms to identifiable protocol which just means that we'll be able to use this in our swift ui lists and stuff like that um okay so now i typically if we if we do want to organize this a little bit i might create different groups and i'll move this into our group like that and uh maybe we'll add a move our content view in there and uh maybe we'll create a new group for data oops i don't want to put that inside and i'll put persistence in there okay so let's leave it at that i'm actually not sure if it's going to build successfully right now because we removed a bunch of boilerplate code let's just give it a try oops is my stream gonna die no slow flow knows exactly what i'm talking about okay so yes i wanted to show you guys some other things so back so from here we've basically generated the classes that we're going to use from this data model using the manual code cogen option which i showed you was just the command in the menu there are these other options so class definition is where you don't have to generate it at all so it happens behind the scenes for you that sounds handy but on the flip side it doesn't give you it doesn't allow you to customize this because right now that we've manually generated these classes i can add my custom methods here you know i can i can customize the product class had you chosen um class definition this would be generated free behind the scenes and you wouldn't be able to customize it that might not be a problem for you if it's not then you can go with class definition but if you do want to customize it go with manual now category extension what is this this is sort of an in between the two options category extension means that it's only going to generate this one behind the scenes for you because this one you're not really supposed to modify although you know we do modify it because of that optional bug that i told you about so you probably have to remove some of these optionals right here and make them not optional it will only generate this one for you where you are supposed to customize you know any properties or methods or anything you want to do with the product class this this is where you would do it you'd typically leave this one alone so in the data model file if you chose category extension for your code gen option then it basically generates half of the definition for you behind the scenes i typically like to leave it as manual none so i i have i know exactly what's going on i don't want things happening behind the scenes that could be causing problems that i don't know about um the thing with manual none is that if you at any time you change these attributes the data types names if you add new attributes or anything like that it's up to you as a developer to generate new definitions to replace your old ones you'd probably just replace this one because yeah then it's not going to match up because this defines how that product object is going to get saved into core data if this right here doesn't match these class definitions that you're using then you're gonna get an error uh i'm not sure all to delete with the default code so yeah i removed a lot of default code from this project that it generated for us so inside the content view i commented out the previews and i removed all of the extra methods there were a bunch of methods here uh there was there was a fetch request here which i got rid of as well because i wanted to type it out and show you guys how to do that and inside here in the views there was a list um which i want to build with you guys on the this session so that's why i just replaced the whole view with just the text hello world and then inside the persistence container i basically commented out this preview property so all this does is it it generates a bunch of dummy objects and saves it into a temporary core data store so that it can populate your swift ui previews if we do i removed my preview yeah that's not gonna work and so i removed my preview that's why um anyways we can move on now so remember back in that slide we basically have everything we need now to start showing some stuff uh i know that was a long wind up but that's that's all core data setup once you know how to set it up once uh it won't be so confusing and you'll just like dive right into it so going back to this core data diagram remember i told you that the core data persistent container is kind of like your data store but you don't you don't use that directly to save and load your objects and to fetch things from it you go through a managed object context so you need a reference to the core data persistent container first in order to get a reference to the managed object context and it's through that that you save and load your data now in swift ui they made this really easy for you actually because this persistence controller this they have um they kind of made it like a singleton although you you kind of still can create additional instances of of this persistence controller but this you can access from anywhere and it will let you access that persistent container right that's the that's this bottom piece right here right so at any time if you want to access this core data persistent container we actually can right it would just be persistence uh let's see oh let me just persistence controller dot shared and this gives us the instance of persistence controller and there's the container property so this is that persistent container which gives us access to this bottom piece right here so how do we get the managed object context from that well if we go back well we don't need to go back because i told you it was a property of the container so if you press dot and you look for view context this is the managed object context this is the thing that we need to access uh to create objects in core data to um to save data into uh the core data store you do it all through this view context now i showed you you can access this from anywhere but they've actually exposed it a different way for us to access and let me show you what that looks like in the entry point of your app which is this core datademoapp.swift that we have up here you can see that they already created a constant called persistencecontroller so again it's basically what we did to get the instance of the persistence controller and then down here they attach this as an environment object or environment value to content view and you can see this this is what they're returning persistence controller which is this up here dot container and this is that core data persistent container that you see right here dot view context so that view context is this managed object context and this is what we are going to be creating objects on and things like that okay so yeah so it's passing this in to content view and then in content view right here you can just access it like that and get a reference to the managed object context and the nice thing about doing it this way is that in any sub-view of content view you'll be able to just do the same thing and get access to this managed object context which is what we need to work with core data okay so hopefully that all still makes sense so far and i know we've been doing a lot of ramp up but we have not yet actually ran the project or created anything in coordinated yet okay so what should we do first should we i guess we should create some objects into our core data store first why don't we do that so let's write a method here where we'll just be like add data we'll add we'll maybe add one product to our core data so first of all we need to create a core data object so let's say let p equals product remember this is the class that we generated from this data model file right this product entity did the code gen here are our product classes so we're going to create an instance of this so back in the content view let's go ahead and do that we want to create it inside of a certain core data context if we want to eventually store this product object into core data then you want to create it under that context so this is where this comes into play we can access the view context from here so we'll just create it inside view context like that and then let's just set some dummy data here you know my awesome product and let's just give it what else did we have we had barcodes i don't know if we're gonna end up actually using these barcodes but okay so now we is this oh right all right so now we've basically created a single object in memory um if we want to save it into core data view context right here has a save method that's what you're going to have to call attempts to commit any unsaved changes to registered objects in the context parent store so this is something that we just created it's brand new it's not inside core data yet it recognizes that this product you know is in that view context and so when you call view contacts.save it's going to try to save into the data store any changes that you've made any new objects you've created any new relationships between objects that have formed so that's what we're going to call but notice that it throws an error potentially it potentially could fail at saving so you can capture that you can either not care and type try and sort of force trying to save and don't care if there's an error or you can wrap this in some error handling like a do catch block so this is how you would do that you would do catch any errors that might happen so you wouldn't use the exclamation mark in that case you would you know here you would say catch any errors that happened or you know what respond to error in saving right so that's what you would do let's try this out let's call this data add data method by a button right here we're just gonna change this to a button okay so for action we're gonna call add data all right are you guys back all right please please chime in are we back you guys good can you see me can you hear me yeah so i warned you guys right my mac is old so that's why i've i've ordered a new mac it's coming in on friday and then we won't have these issues right now with this mac it it cannot support compiling code in xcode and streaming at the same time so that's why it's been kind of difficult to uh to code and to show you guys things i've gotten used to streaming i really love hanging out with you guys right here however it's just my computer is chugging along so we good again okay great glad to hear that so hopefully i'm going to try to minimize the code building but when we you know try to fetch the data we will run into the same issue hopefully it's only for about 10 seconds um and then we're back okay yeah need that m1 come in on friday and then hopefully the monitor comes as well soon and then on tuesday next tuesday hopefully we can do some building and we won't be experiencing any stream issues um all right so now the simulator has launched on the screen i'm going to hit tap me and someone mentioned sami you mentioned to explain the function part okay so i'll explain this again after i tap it we'll see what happens okay i'll set a break point right here at line 31. and we're just gonna click this button right here and tapping on that button calls this method add data so execution has come down here and what we're trying to do here is create a new product uh object and we're gonna set all of these properties but the important thing to note is that we're creating it in this managed object context which is essentially just saying that we want to work with this product object inside core data so i'm going to step through the code right here line by line as uh and we can sort of explain it so this is just setting the different properties for that product and then down here we're calling view context.save and this is going to save any changes or new objects that we've added to the context like we have here or any new relationships that have formed if we have multiple core data entities and we have relationships between them and we maybe have established the relationship a new one when you hit save it's just going to preserve all of that into core data so i'm going to step over this as well and nothing seems to have gone wrong all right so that's it so now we have a product object inside our core data store you can't visually see anything right now because we haven't shown anything but now that's where the second part is going to come in we are going to fetch that data back out of core data so this is essentially yeah so this is adding data while we're here let me show you um what you would do if you wanted to update something in core data so all you would do is change whatever you want to change let's say you wanted to change the name or the price or the you know whatever properties you want to change just make those changes and then just call view context.save again it's going to preserve all those changes back into that object in core data so that's creating and updating okay so now let's fetch it back from core data and inside swift ui they actually make this really easy so there is a property wrapper i mean this is one way to do it you don't have to do it this way but it's kind of a nice way to work with inside a swift ui project so you define this fetch request and there are multiple parameters that you can do so usually this is the one that i'm using sort descriptors predicate and animation i have to admit that the animation property here i don't usually do anything with it and this parameter is completely optional if if any of you guys use this animation property in a fetch request have some experience with that maybe flow you have you can talk a little bit about this parameter in chat but typically to me these these two parameters are very important so short descriptors you can provide an array of them each sort descriptor describes um how you want to sort the data coming back so you can specify an attribute to sort by and whether you want it to be ascending or descending and you can have multi-level sorts so you just specify multiple sort descriptors for this basic example i'm going to put in a an empty array like that and for predicate this is where you specify some criteria for what you want to fetch back this is optional for this fetch request i can just completely remove this parameter here and that will fetch all of a single entity type back for me so that's what i'm going to do now and then later we can take a look at specifying a predicate okay so now let's specify the property so var this can probably be private var since we're not using it outside and you can actually make a new line as well just so it's a little more neat and let's call this you know product list and the data type for this is going to be fetched results and then you have to specify the actual data type that you're trying to fetch so in our case here it's going to be product and so the nice thing about what happens here is this is automatically going to populate for you from core data it's just going to based on the sort descriptors that you have in this property wrapper based on the predicate that you specify here it's just going to go and make that um fetch request into your core data store return it and populate this property so that you can use it right away inside your inside your view here okay so let me let me show you that okay so let's put this inside of the stack and then let's add a list so we are going to list our product list and let's just display product name let's reindent everything okay so add a product to the data store and this one is display products in a list so since the name can be optional we'll add a nil coalescing operator which allows you to specify an alternative value if this happens to be nil so we'll just do that for now all right let's quickly check the chat uh deodoxy what mac do you have this mac is actually pretty old it's a 5k uh 27 inch imac 5k but it's like a quad core i5 it's like a 20 mid 2015 machine which has been running smooth and fine it's just that now that i want to use xcode and stream at the same time it's it's choking so i can't can't but the mac minis are so you know they're kind of affordable now all right awesome let's come back here um so what's gonna happen now is when we run this app which i'm a little bit hesitant to do again because it's going to choke up the stream this fetch request is going to be populated automatically it's going to go into our core data store grab all the products and assign it into this fetched results array essentially it sort of works like an array so it's got the count property you can use indices to fetch specific items from this list here and then in terms of the view what will we see well we're going to see that button and then we're going to see a list of all of the products inside our core data store right because we are iterating we're looping through the product list right up here which you know is fetching all of our products from core data so okay so let's try this out i'm going to stop this project and i'm going to rebuild it our stream is going to die again for a good 10 seconds but nobody go okay you stay stay here and you'll see what happens in the simulator you're gonna see that there's one product because so far we've only uh tapped this ad data button once so we've added one product to our core data store so when we launch this app and it's fetching all the products it's only going to bring back one product so we should in theory see one product in our list okay here goes okay let's go work hey our stream is still good it was just the first time i was building it for the first time and i was just looking at the chat so it seems like the stream is still up everything is good thank you 2015 mac for holding up and not embarrassing me in front of a ton of people awesome so check it out we've got this product which was in our core data store and it got returned so it's showing up in the list now so let's tap on this button to add another product into core data and here's the cool part look it showed up right away that means when i when i tap this right what's happening is it's coming down here and it's creating a product and it's saving it into core data right that's all it it's doing it's not updating that list up there but it's adding that product into core data and then this fetch request is being kept up to date right it's fetching all of the new products that we've added automatically and because this changes our list here in the view code this is displaying as it's just reflecting all of the new products that are coming into core data so how cool is that so the setup you know sort of in in conclusion the setup for core data was a little bit um you know you have to wrap your head around it a little bit um but then after the fact it's not so bad like in terms of actually doing the creating retrieving updating and deleting uh we have we have time i'm going to show you guys the the predicates so you know how do you perform a query or how do you return a subset of your data first of all i think we need to add some different data in here so let's say my awesome plant we'll just make this like 29 bucks uh and then i will just rebuild this let's add some plants plant products and so we have something to something different okay stream still holding up awesome okay so we have a few plants we have like four plants and three products so now i'm gonna go back to our fetch request and let's try to fetch only the plants for example so remember how there was another parameter which i got rid of which was called predicate and here you specify a new ns predicate is there just the predicate i think it's yeah ns predicate okay and here you can specify essentially what is just a string um and you can specify that query now typically what i do is i just go up to google and i just type in ns predicate and i get some help with this so apple developer documentation ns predicate here are some simple examples such as something double equals something or you can do like a contains you can do it like there is a more detailed guide predicate programming guide right here that when you click into it tells you more about the types of queries you can do for our purposes i think just demonstrating something like that will be fine there's also predicate cheat sheets i don't know if this is still i mean ns predicate hasn't changed so this should still be okay all right so this is kind of useful okay for this one um let's we want to use contains we probably want to use contains yeah so here we would say name because that's the attribute where it contains right so we want to where was this we want to choose all the plants right so i can't remember i think i have to put this in single quotes in here if this doesn't work then we will we'll change that but just by specifying a single ns predicate with a single criteria like that you're gonna see that we only get those all right and looks like i don't need those oops looks like i need to take a look at something here let me take a look at these predicates again hmm you know what we can try instead let's try this go back for a second and then we are see we're going to put this as a wild card and then we're going to substitute plants in there i don't think this needs to be caps although i'm not sure that might have been the problem we're not getting our plants i'm doing something wrong here contains left hand contains the right hand expression no stack overflow yeah um well all right let's do it core data uh predicate contains all right let's open up these two uh he did okay single quotes you know what i did i i don't think i capitalized my contains i think that's what happened these predicates always get me so let's let's try that uh why are you running mojave this is actually big sir am i mistaken yeah this is actually big sir guys i'm not exactly sure why my contains isn't where oh you know is it oh i should be should have been looking for plant there is no plants it's my awesome plant guys begins with yeah that might have worked too but i was actually i was actually looking for the wrong thing plants doesn't exist in our core data store it's planned so there we go yeah terrible demo but i hope you guys got the idea i always struggle with these predicate expressions but uh definitely looking at some online resources and doing some some googling using the predicate guide will definitely help and then if we want to sort it well there's no point in sorting it because all of our our data is the same right now hopefully that gave you guys a good primer into using core data it looks like we have some people in the audience who are who are familiar with it yeah classic mistake you spend hours trying to figure out what's wrong only to realize that there was like a little typo or apostrophe missing or something like that yeah i love it and doing it live on live stream doesn't get any better all right so that's all i had for you guys for today it's about time to wrap up but let's let me see if you guys have any more questions and yeah this is going to be available as a replay i might clean it up a little bit and maybe repost it or maybe i'll just repost it as is hey call of programming nice to see you thanks for joining so meet scott mark thank thank you guys hey duane you just finished the ios foundations course that's great it's awesome so the next time i'll be streaming is probably on tuesday ali awesome ali has joined the stream thank you so much for your uh is that a sticker or a donation i'm not sure i'm new to all of this but thank you so much elite worked with us at code with chris before and uh he worked with core data as well so he was one of those intern co-op students that i told you guys about a couple of streams ago so every four months we get a new student from my old university just to give them some work experience so that's awesome ali i'm so happy to see you again hope you're doing fine yeah uh this fetch request really really makes things uh easier because it's like kept up to date if you don't do this fetch request property wrapper you still can manually create a fetch request and then execute that to grab your grab your items that's definitely still available oh yes i was talking about the my next stream so i think it will be tuesday next tuesday so hopefully the new mac has come in uh i i want to try to build something i'm thinking about what that should be either the new community app challenge or maybe i will go through some of the old ones because to be honest i haven't built the weather app or the stock tracker app uh that have been issued to the community as challenges and i know some of you guys in in the audience have actually attempted that challenge so i myself haven't done it the source code that we post like the solution that we post for those community app challenges are actually built by the co-op students that join us and that's sort of like their ramp up into swift ui um like ali built some i believe and right now our current student jesse he's worked on an nba like a sports uh stat statistics app and also another app that integrates with health kit for tracking your water intake uh and then the last one was a new york times news reader so those will eventually be issued as community app challenges as well so i think i'm going to try building those might be a good way to break into coding live let's see yeah anyways i want to thank you guys all for joining i'm going to call it a day and uh i'll see you guys on tuesday so if you want to just make sure you have the link to the streams it's always going to be at cwc.teo streams you're going to see all of the replay links as well so if you want to get the replay for this you're going to find it you're going to find it here all right so again thank you guys so much and i'll see you guys next time
Info
Channel: CodeWithChris
Views: 3,933
Rating: undefined out of 5
Keywords: Xcode, Swift, iOS, Coding, Programming, iOS Development, core data swiftui, core data, core data tutorial, database, swiftui core data, what is core data, core data swift
Id: kIxQORl_Te4
Channel Id: undefined
Length: 64min 13sec (3853 seconds)
Published: Tue Jun 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.