Finishing adding CoreData save functions || MyWheels Replay #004

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so do so oh man all right there we are oh man all right is that bad can i still hear my kind of okay i think that'll be okay [Music] [Music] all right hello everyone i have different headphones on and they sound completely different anyway um how will i start will i ever start the stream consistently probably not but that's okay um welcome we are trying something new i did a whole new overlay i have trying new things so bear with me while it happens um because i'm not sure what i like i'm not sure what i don't like or just we're trying different things here and that's what matters i guess um anyway i knew i didn't stream yesterday so sorry i had other i had i was having a day i was having a morning oh thanks monsieur we're trying out new things we'll see as it goes um i i'm pretty sure this is probably against the apple designer rules but i took their um i took their like things around they're um they're like fire for their friend their photoshop files and i tried something new um yeah yeah that's definitely something i need to play with some more is getting that contrast there um either i could probably just make it bla a black chat window i just wanted it to be colorful like the coffee cup was but yeah definitely i this is the first time i've actually used it live so we're just trying new things um let's see i nothing is lined up yet because i haven't used it live and i didn't try very hard to make sure it was gonna work correctly so let's go to xcode um oh it works hey look at that now um yeah oh because it's just zoomed to xcode well that's great i love when stuff like that happens ah it's like i plan i don't think i could have planned for this anymore now can we i need okay oh no go back but that's what happens when i don't like line everything up there we go and then let's okay so if i expand it there we go we're better all right whoo check that out this is actually looking a lot cleaner than i thought it would um yeah this is looking a lot cleaner than i thought it would so that's not too terrible i don't know how this is gonna i don't know how this gonna i might i still might end up tweaking it or losing it or something but this is way better than i thought it'd be i wonder if i just make the track well the chat box needs to not be clear because i feel like that definitely would not work correctly but i think we're at a point i think i think i like um no i actually don't say they say day i do not want to become famous it's cool though okay let me sorry i actually have never done this before chat settings [Music] show mod icons there we go delete it cool um but yeah so hopefully this looks decent and we're gonna keep we're gonna go hop into it um obviously i don't have a spot for the simulator quite yet i'm pretty sure i'm just gonna pop it down in the bottom right and just not care um about where it goes but here we are this is this is what it looks like now which i'm actually quite quite happy with um i might have to design something else for the simulator actually like a little a different type window but i feel like it just going like right here in the file explorer area like does not matter all right um let's let's hop into it so i've been working on some core data things putting in core data um getting some structs in getting some um getting some extensions in that's what i did yesterday oh hold on something i was not ready for i did not set up my toggle window um [Music] so basically last week i decided i was going to be [Music] oh there it is okay there we go that should be better um see i'm ecam and their system audio i have no idea why that's on um okay great so last week i realized i was causing an issue or i was having an issue with um that's fun yeah i realized i was having an issue with like with final cut and all this stuff so i was like i'm gonna reset my computer and just like it's gonna be fine and i did that last week and i took that opportunity to completely reset everything else i've been doing also so like um like this i mean it took a time to reset like everything so that means ecam over here that means like basically everything on my computer is just new i went back to using chrome as my default but that meant like everything got messed up and i didn't like try to fix it um all right so what was i gonna do here um i need to be better at time tracking i it's not a need it's a want i want to be better at time tracking my stuff um purely so i know how much time i'm putting into this and because we can see i've already put in some time here but um and real quick because i just started the timer if you're ever curious about um like how the project's going where i'm at we actually have a new website that we can go to um and it's m wilson underscore codes.cctplus.dev um and it's basically built on obsidian so if you're not familiar with obsidian um project website it's a pretty neat like markdown platform i would definitely recommend like checking it out um but basically it's a i still need to write like exactly what exactly that this app is because i don't have a good job of doing that um but it is a it's like a markdown wiki style app and they have this plug-in where you can just publish online so that's what this is and it's kind of nifty with all the like graphs and such um this is just like purely just a place to live and exist differently on the internet cool all right so anyway i just want to put that out there for everyone um i need to make that like a command i can type in but there we go all right um what is orbit monster am i not um orbit what is like how do i how do i google this am i am i yeah i don't think i'm gonna mission control is it this oh this looks fun do you use orbit for time tracking i see that's what you were saying uh where are my i don't have my note where [Music] there we go um hey dragon dust welcome no it's not this one okay um you should be can you drop a link in the chat i'm curious um hey dragon dust welcome welcome it's been a while anyway okay so we have that going we're going to hop back into this xcode here my sound is changing is it ecamp ecam's probably doing something [Music] reference it oh uninstall system audio is probably what i want to do i usually never use the system audio can i just turn it off right now ah broadcast system audio when sharing the screen that was the issue ha ha okay cool yeah let me know i'm curious so is it like for time tracking is that what you use it for i've been super i mean i've used toggle in the past which is why i'm using it now but um i'm always curious because who doesn't like getting lost in new tools um it's like the aspect rate um it's more for freelancing and sending the invoice that makes sense but the charts are pretty [Music] huh that's fun i'll just add that to the bookmark bar for now so i can look into it i like the i mean it looks pretty oh that's why haha maybe [Music] oh i figured out the ish issue that should be gone sorry oh nice they're they're a couple of developer a couple of devs that's awesome orbit time tracker i like supporting people like that obviously ah i figured it out [Music] and then we drop it below boom now it looks decent all right um neat i'll have to check this out i have it bookmarked i'm going to check it out thank you i literally want to get into freelancing and quit my job purely because i just want to work on ios stuff all day the web stuff is fun but alas we'll see what happens um all right let's go into the core data as such because i'm making all these wonderful wonderful things um [Music] i don't actually know if i need to do a stretch like this but i feel like having extract a separate like a separate like model strut would be you is useful i'm sure it's not as useful but i feel like it's useful if i want to follow more of like the mvvm style things where the view is where i just let the view take care of the view and then i pass things in as i need to um and that way like it's all like if something were to happen like and i decided to quit core data cloud kit at some point like i can substitute things in i don't know i've done that before and i've it has survived basically i like i don't know if i like it is the term but it it works well for me um all right so we have the user we have the vehicle i don't think i really need anything else right now to be honest well yeah i should i should just go with the flow and get this all in correctly um new file [Music] location oh no that's just a swift file is what i need [Music] let's work from the bottom up since i have a user in vehicle so maintenance record plus extensions and then also maintenance record um [Music] uh maintenance record model is what i want here i forgot so yesterday i turned on vim mode which is why it's like oh you couldn't type and you just typed everything because i am trying to be more like keyboard dependent when i code and rather than having to reach for the mouse all the time no other reason besides the fact that i am trying something new record all right so what i've decided is that i always think maintenance record is spelt wrong no matter what like just always it's always felt wrong for me uh cool like no matter what i do i always feel like i'm just i spelt it wrong um [Music] all right let's do let's do it [Music] this should actually be attachments right yeah why did i just call it attachment that should be attachments because you can you should be able to upload multiple attachments so it's going to be like an array of a string [Music] um that's just wrong of our notes equals a string so we can just do a blank string our name equals quote yeah go get back ah okay import here empty collection require oh duh okay um let's do a [Music] right that's all it is it's an array of strings yeah that should be doable now right yeah there we go all right so then here we will do a struct i mean not a struct it's class or an extension of maintenance record um funk i think i've just been calling it save [Music] right that way i'm just like copying exactly what i need here yes i don't even like i said i don't know if i'm doing this exactly right but i think it'll get close enough if i end up having to redo some of this to clean it up later that's okay i just want to want to make sure it's i want to make sure i'm well i'm it works basically at the end of the day um so inside the maintenance record we're going to copy in um i need the context [Music] and then i need the actual model i mean the vehicle model and the other thing i need is the vehicle so the other thing i need is the actual vehicle that this comes from which that's i don't know why i said it needs the vehicle there but i mean i'm not wrong i do that way it associates um record model wow i am all over the place this is great i'm sorry i disturbed you oh my nose is not happy can i get rid of the minion map i don't need it [Music] minimap command shift and there we go the files are not long enough whatsoever to want the mini map um i think that's right right i know i need the vehicle to associate it with the vehicle to create that relationship [Music] um let's see that way [Music] all right um [Music] we can just look together creating manage object relationships uh because i just need it to be like associated together and maybe i'm just like overthinking it i really don't think i am though but i just want to make sure i'm like thinking correctly okay but how do i associate them inside the code like i'm aware of how to do it here i still need to tell the tale the relationship like whenever i save it like but how'd you like to actually like associate it with this right like [Music] like and i always think i'm so silly for like trying to think about this because like i feel like i'm i'm always one that's not like i don't know i just feel like i'm always the one that's like googling it to it but um [Music] i feel like i can never find the answer correctly and i don't remember how i did this last time how i've done this in in my other my other apps i guess i could go look but then i have to download them i may have to clone them um well it's pretty simple let's have an example you have a branch of a brand a specific okay um [Music] now all you now you're all set you'll find an ns set object in your branch class that holds the data related to the specs of that branch also you will find a method called add specs branch [Music] [Music] do okay so i think i'm actually overthinking it i feel like i'm actually overthinking this but it'd be really nice if i could see one more thing that proved that i am overthinking it [Music] [Music] all right um one see you usually like hacking with swift helps enough to like say i'm understanding it but i've looked at it a lot and i still don't understand it but we'll find out um and like i was going through donnie wahl's book and it's just it didn't have what i needed in it like to actually say i understood it but that's okay okay so also open your candy with a string attribute called name contribute in a country with string attribute called full name and short name although some types of candies have the same name see smarties countries are definitely unique so place so please add a constraint for a short name don't worry if you've forgotten to how to add constraints because that way that completes our entities next step make a okay however things are complicated are more complicated when it comes to candy because this isn't a set yes we have to sort the candy [Music] and then so this fetches the countries we have we don't specify anything about the relationship in our fetch request as for the body view of the view okay so this just adds the origin okay so it'd be like candyone.org so this would be like vehicle dot uh vehicle maintenance record dot vehicle equals vehicle at the at the moc so i don't need this to come in i think is what i'm understanding because basically i can just reference the the one vehicle itself now i can say um let maintenance record let new record [Music] equal maintenance record with the context of context yeah i feel like this is making sense and then it's gonna get all upset but that's okay yeah dot vehicle [Music] ah okay equals vehicle at manage context no add context [Music] uh record dot attachments new record dot date [Music] equals record dot date because it's all the same name equals record dot name whoops not map new record dot [Music] notes equals record dot notes [Music] and then i don't know how i'm gonna handle that location yet i don't think i have to but that is that is something to handle at some point um all right and then i realized that i forgot probably did i forget something in here i don't think so um i think that's perfectly fine well okay so right now i'm kind of not tracking the you i i don't think i need to track which user actually puts in the maintenance record do i i don't know yet we'll play with that that's fine all right so now it's just the fun do try context.save print uh maintenance record saved correctly is all will do um you are wrong in the scene what oh you are correct i am thank you all this code just magically appeared thanks dragon dust this is why i should just keep the google at the bottom right and just use that instead of switching scenes all the time haha that would make a lot more sense my bad thank you and we'll just put the catch here so that it can stop yelling at me because i don't like when they yell and by yell i mean just show the red i should probably make a proper air handling system [Music] all right um prince [Music] all right i probably can't [Music] yeah it's not gonna let me um because what would be neat would be to like have the vehicle like print but i don't know if it needs to print necessarily but that's fine all right so that's fine um maintenance record is done let's do um oh my goodness everything is upset let's get location ad i think location actually because the location is going to be public since so the whole idea is that people can add locations so a street i mean a name like in an address so to say um so that people can like use that location data and you don't have to constantly keep putting your own location in i keep putting locations in over and over and over again um i don't think i'm gonna handle location yet because i think that has to be in like a separate store or a separate like data file um i could keep just locations private and then have like a public location and then they could i feel like that gets messy um but we can do the energy phillips right now because the energy fill ups are unique to the actual car and to the actual user so that's not going to be public so we'll go ahead and get those um get those in at least that's my thought process in this uh and how this works yeah that makes sense um [Music] where's the skill they're good um i act like i've never made a struct before in my life every time i go to make a struct i don't know why but i'm always like i don't know what to do next and this is what i'm supposed to do energy fill up model [Music] um amount of fuel [Music] attachments attachment [Music] wow i cannot type i mean we've already just we've already discovered i can't type today but i really can't type today sucks that i have to do lots of coding today to get some stuff done for work [Music] uh dates [Music] i don't need to put double in there um [Music] we'll put gas for now um because it should default to gas i think that would be the good default there um i know that there is i know that there is not uh i know that there is more like types than gas which is obviously what i'm trying to get at um but gas is a good default i feel like for now to be honest like there's nothing like i don't know for me it's a good default um what i just realized i probably need in here is also a currency like if i want this to go if i want this to go international like a currency would make sense and not just assume like the us because i don't know you could possibly i mean you like i'm guessing that there could be a case where you have a car in a different country and you want to log it but you want to log it not in your [Music] in your native currency you might want to log in something else and of course this could be based like this could just be based on like the what the phone has i guess i think i can grab that look at look out currency info but we'll find out um a string would be fine [Music] can i even grab that info uh [Music] okay um keep let's find out that i can grab it first [Music] uh get currency of device swift i don't know if that really makes it get local currency and swift you can get the currency pretty easily just with the locale currency symbol and the currency code this correlates with the user region format settings and works in both ios and mac os that's nifty all right well i will take it so that totally makes sense to me at least um yeah and if there's a currency code i feel like there's that's what i need to store all right um oh so amount of fuel that i should so with this being the currency also i should probably also like take into account um it's gonna also bleed into maintenance record because a lot of these all live with maintenance record as well um basically i feel like i need like a units but not like a unit sir like i need like a unit um in here i am probably way overthinking this uh what am i thinking here um units of uh whatever i'm just going to call it units and i actually want to do one i need to come back in here and add um the cost inside the the maintenance record also but at some point um all right but this is this looks right [Music] and then var units equals um gallons i don't even know if that's the right shortcut but it'll be good good enough for now um function save [Music] energy fill up [Music] uh so this is going to be context ns manage object context which we also need the vehicle of right no we don't have to pass that in no we don't i i know this we do not uh energy oh my goodness what is going on [Music] it's because i have been mode turn on and i need to learn it better all right energy context and it's managed object context and then we need um here wow today is gonna be a date you fill up uh yeah there we go oh thanks for the follow luck jan welcome in did it fire the cool new alert i hope it did hold on i have to go see if if it did real quick it should have go into dashboard i just want to see if it'll fire because like i made a new thing and it'd be really cool if it did there we go awesome yay sweet i like anyway thanks for the follow luck chan welcome into the stream hopefully you're having a great tuesday all right so let's get this save function working here um let new energy fill up equals energy philip context is the ns managed object context equals double equals a new fill up dot all right they can't both be new it's just gonna like hinder the um hinder the speed to add things to you amount of fuel the property is to find energy fill up and may not be available in this context um it should be [Music] philip dot i'm out what is going on oh because it should get context that's why that's what was happening there we go got attachment equals fill up dot attachment dot cost equals philip dot cost dot um currency this is where i could actually instead of having to rely in the strut on making it let's get the locale and let's just set it by i mean yeah i mean i feel like this would probably be useful to have elsewhere or just make sense in this direct no we'll do it here um i cannot contain storage stored contained that's right delete i'll just do it when i need it that's fine okay all dot currency code or fill up dot currency since there's a default value in currency this makes sense so it can either grab the local of the currency code or it'll take the default value for whatever the currency is um i feel like i need to have like a part of the settings view is definitely going to be a um i need like a to-do list i have not even set up a to-do list whatsoever inside for this app um yes i have that's a lie i have one at the air table i love that i have these like everywhere [Music] all right um [Music] i didn't do that yet uh okay so i need to instead of just add a vehicle [Music] i um need to add a local option for settings and add a setting option to override defaults for currency and units [Music] task to do [Music] that's going to definitely be in 0.0.1 all right um this is just it's an air table base just tells me the work that i need to do that kind of stuff um it's also neat because then i can add a a form and i could like link the form inside the inside the app at some point to like actually log in to actually like log bugs from the app which is pretty nifty but yeah all right so we have that new energy currency fill up or that we already did the date new energy fill up a diet type equals fill up dot type excuse me new energy fill up dot units equals what else comes with low kale because that might be what i need also oh there's a okay so this is really neat i had no idea um a bullion that is true anyway i think that might be uh i think units makes more sense and we're not going to try to derive them because i like to derive like a special units because like what if you have like an electric car and then it's like kilowatts right i'm thinking i could be wrong about kilowatts it's like whatever batteries are measured in i should be better at this um or if you have um [Music] or if you have like you know gas versus electric versus whatever type there is that you want to measure it you might not be measuring in in whatever the proper units is for liquid measuring so we'll just say fill up dot units okay and then we need to associate this to a vehicle so a new energy fill up dot vehicle equals vehicle at context um and then like i said i'll handle location later now we need to actually save this ado try contacts dot save print uh fill up was saved correctly got print error saving philip fill up philip um and we will say this is it and we'll just print the error okay um energy fill up location was the last one i think this is what we got um i should probably inside here we need to associate the user new vehicle dot users [Music] uh users dot [Music] i know that's i will find out what happens anyway all right so that should be all the options here this should be does it not like remember sort by name no it does not that's neat let's add these um added more core data things very specific there all right so poor dad is added in um i think actually that's probably all i'm gonna do for the day i didn't plan much more besides this i don't want it to get too much more basically for this um just because i think just because i don't want to go in the weeds too much um so the next thing is probably sometime this weekend what i'll do is add a either this weekend or maybe tonight i might stream again tonight i probably will stream again tonight i like streaming at night last week um i need to actually start working more on the views and getting those in so i will probably do that later tonight so if you're not following follow now that fun stuff um thanks you guys for watching and tuning in i know i didn't go too terribly long but i still appreciate watching tuning in um i will see y'all in the next one bye you
Info
Channel: maeganwilson_
Views: 28
Rating: undefined out of 5
Keywords:
Id: D8A5qgWGVUw
Channel Id: undefined
Length: 50min 47sec (3047 seconds)
Published: Mon Nov 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.