iCalories: Full iOS App with Core Data Tutorial in SwiftUI (2022)
Вставка
- Опубліковано 15 лип 2024
- Today we will be looking at how we can create a full iOS app in SwiftUI with Core Data. We will be creating iCalories, an app that keeps track of the food and calories you eat throughout the day.
Source code: github.com/federicocotogno/Fo...
00:00 iCalories Demo
01:41 New Project
02:30 Data Model
05:20 DataController
10:35 Injecting the Database
11:21 AddFoodView
15:27 TimeFormatting
17:57 ContentView
30:53 EditFoodView
34:34 Completing the app
Even 2 years after release, this is one of the most helpful videos for app development I have ever been watching. Thank you!
Thank you so, so much.
I've been wanting to make an app using CoreData, but haven't found a tutorial as detailed as this one. I hope you continue to post more videos like this and I'm ready to watch and like all your videos.
Very well done. Appreciate the play-by-play as you code explaining what each line does.
Awesome tutorial, precise and simple and with grouping swift files in folders teaching the right practices , this is great for a beginner or someone looking into learning coredata.
OMG! I’ve been looking for a video on core data like this!! SO we’ll explained and easy to follow. You are a fantastic teacher. I look forward to more videos from you. I’m a subscriber!!!
Excellent tutorial and quite simple to understand for those new to core data.
I really love this tutorial! A huge thank you! ❤
Thanks a lot, I learnt a lot. You are the best.
Thanks for the tutorial and the clear explanation. This will help me a lot!
Thanks so much!! Very helpful!
Great video, very helpful
For the time formatting at 17:13 the condition can be modified to:
minutes < 60 (to cater for minutes)
minutes >= 60 && hours < 24
Just to avoid i.e 95 minutes.
thank you for this great video!!! It is really helpful
great tutorial thank you for making this
Brilliant! As a beginner programmer I really appreciate this. Thank you so much!
Great one !
Extremely…..helpful. 🙏🏼
love this video!!!!❤❤❤
Thanks a lot !. I just hoped that you could've explained more about how it works. : )
great video thank you :)
very good video..easy to understand
Thank you so much. I really appreciate it. This will help me a lot!
Glad it helped!
very good,thanks😊
Super nice tutorial. Thanks for sharing the code and pointing out the times. You explained it easily understandable and your code makes sense.
Glad it helped!
Thank you very much!
Great video.
Great video really thx pls do more with Core data and Custom Calendar
Thank you so much, Core data was so confusing and complex for me before this video. wasted over three days on how to update a particular entry from core data. Love from India 🇮🇳
So helpful! Thank you!
Glad it was helpful!
Thanks Bro 💯🙏🏻
Frederico, this tutorial is perfectly placed to learn Core Data and full CRUD functions. I have been following SwiftUI tutorials since SwiftUI was launched, and never have I seen a tutorial that is so straight-forward as yours. Most other tutorials get unnecessarily complicated by adding extra features and methods (e.g. not related to Core Data), which makes it difficult to focus purely on the purpose of the tutorial. I will both subscribe and follow all of your new tutorials. Thank you for your wisdom and generosity in publishing this great tutorial!
Thank you for such a positive comment! Unfortunately I don't deal with iOS dev anymore, but I'm happy to hear it was still useful :)
@@Indently My pleasure, in deed. If I was continuing my Python development, I would follow your Python videos, also! Be well.
Great tutorial, thanks for making. Have you done a tutorial of interacting with an online service for data?
Thank you…
Thanks!
I really appreciate the support, thank you mate!
thankssssssssssss
Thanks Federico for this outstanding CoreData Training,
Is it possible for you to develop an extension to extract the generated data into a PDF sheet as an report, an E-Mail report and a file which can be uploaded to Excel for further use.
Thanks a lot, I ll keep learning and improve my skills for my own application.
Gerd
I dont know will you read it, but you can create extension for NSManagedObjectContext and add there addFood and save and other functions and in the view you could write context.addFood(), context.save()
Great video! The Add item toolbar item click was not working after the first data entry. it works randomly and ignores a lot of taps on the simulator. After breaking my head and reading about different solutions in the wild. Comparing code & copy pasting each code file separately with the sample code, I realized it works on iphone 14 pro flawlessly. It is showing random issues in iphone 14. Guess there is a bug on apple side and i will think twice before I use a toolbaritem on my real app :P
why didn't you use ".environmentObject(dataController) " modifier?
top
Thank you so much for a wonderful video!
Currently, you are using a single class DataController for managing all the operations related to Core Data. What will be your recommendation for a more complicated app. Will you introduce more controllers like CaloriController, FitnessController etc?
Thanks again!
Such a pleasant surprise to have you comment on one of my videos! I watched a lot of yours when I was learning iOS 😁
It’s been quite a while since I did anything with iOS, so I wouldn’t be able to tell you at the moment.
Keep up the great work with your tutorials through!
@@Indently Thanks for wonderful videos.
@@Indently Hi Indently, can I ask why you stopped working with iOS development? Did you decide to take a different career path, or was it simply a hobby and your work requires you to work in Python?
I would love to hear more about your story, thanks!
Thank you! Is there a way we can Encrypt and Decrypt data inside Coredata for security purposes? (this was reported for one of our app during PEN testing)
Hi thanks for your video, I have a question, how can I 'import' a .csv file into my Coredata environment? and can I use search function to search through my Coredata entity for specific words, similar to using sql statements, thanks Pierre
Very good video! But what do I do if I want to have two data models? I have tried but the app crashes and I get this error: "The fetch request's entity 0x2812288f0 'TheItems' appears to be from a different NSManagedObjectModel than this context's"
Really great video! Do you have any idea how to get rid of the “CoreData: error: +[Food entity] Failed to find a unique match for an NSEntityDescription to a managed object subclass” error whenever you add an item to the list?
Nevermind. I found a solution. If you were curious, in order to get rid of the error go to your DataController class and add the line
static let shared = DataController()
Than go find where you created new instances of a DataContoller and replace
“DataController()” with “DataContoller.shared” without parentheses
The 'timeIntervalSinceNow' value is in milliseconds. Why didn't you first divide by 1000 to convert it to seconds and then divide by 60 to convert it to minutes?
Isnt DataController just the equivalent of a Repository in spring boot?
The calories go in increments of ten but I'd like to have any increment, so instead of only 110, 120, etc how could I do 101, 105, 108, etc?
well I answered my own question. However, when I click on the item in the list it won't take me to the edit view. Instead, it's a lot of code text in the middle of the screen: (entity: item, ID ......... and on and on. Any idea why this is happening?
I followed the tutorial and just made changes to fit my app (Entity is "Item", attributes are "name" and "desc" which are both strings. Any help would be appreciated.
How can I populate the database with data? I only want to edit it and run the app with pre-loaded data.
when we edit food time shouldn't change
Getting error "Food not found in scope"
Restart Xcode.
hey bro I need a reddit bot can u make that I will pay
very helpful to me, thank you very much~
I had a question. I noticed you were force unwrapping food.name. Is it not possible to get a nil value for food.name with the code we have currently?
I think you can just remove the default value of banana from your data model and it should provide nil if there's nothing