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

КОМЕНТАРІ • 68

  • @vladimirschreiner6226
    @vladimirschreiner6226 5 місяців тому +4

    Even 2 years after release, this is one of the most helpful videos for app development I have ever been watching. Thank you!

  • @Park_Suho
    @Park_Suho Рік тому +4

    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.

  • @antipov2
    @antipov2 Рік тому +3

    Very well done. Appreciate the play-by-play as you code explaining what each line does.

  • @rafaykakar8964
    @rafaykakar8964 Рік тому +5

    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.

  • @user-zl6qv9vn1z
    @user-zl6qv9vn1z 11 місяців тому +3

    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!!!

  • @johnpill1
    @johnpill1 Рік тому +1

    Excellent tutorial and quite simple to understand for those new to core data.

  • @arnoczkyzoltan6158
    @arnoczkyzoltan6158 Рік тому

    I really love this tutorial! A huge thank you! ❤

  • @ostanjaffcompany173
    @ostanjaffcompany173 2 роки тому +1

    Thanks a lot, I learnt a lot. You are the best.

  • @marcusluis_s
    @marcusluis_s 9 місяців тому

    Thanks for the tutorial and the clear explanation. This will help me a lot!

  • @richardsommer4204
    @richardsommer4204 Рік тому

    Thanks so much!! Very helpful!

  • @appdev1686
    @appdev1686 2 роки тому +4

    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.

  • @bodeproppl837
    @bodeproppl837 Рік тому

    thank you for this great video!!! It is really helpful

  • @tyrzong
    @tyrzong Рік тому

    great tutorial thank you for making this

  • @BossFloYeaLike
    @BossFloYeaLike 5 днів тому

    Brilliant! As a beginner programmer I really appreciate this. Thank you so much!

  • @nawodyaishan
    @nawodyaishan 2 роки тому +1

    Great one !

  • @adamgumm2265
    @adamgumm2265 Рік тому

    Extremely…..helpful. 🙏🏼

  • @zjfeng8447
    @zjfeng8447 Рік тому

    love this video!!!!❤❤❤

  • @dgh6565
    @dgh6565 2 роки тому +1

    Thanks a lot !. I just hoped that you could've explained more about how it works. : )

  • @XXX-fp6ob
    @XXX-fp6ob 2 роки тому

    great video thank you :)

  • @everyontech2716
    @everyontech2716 Рік тому

    very good video..easy to understand

  • @ricardokaka8896
    @ricardokaka8896 8 місяців тому +1

    Thank you so much. I really appreciate it. This will help me a lot!

    • @Indently
      @Indently  8 місяців тому

      Glad it helped!

  • @relax_music668
    @relax_music668 10 місяців тому

    very good,thanks😊

  • @technergy_de
    @technergy_de 7 місяців тому

    Super nice tutorial. Thanks for sharing the code and pointing out the times. You explained it easily understandable and your code makes sense.

    • @Indently
      @Indently  7 місяців тому

      Glad it helped!

  • @kevincueva4419
    @kevincueva4419 2 місяці тому

    Thank you very much!

  • @MarvelousLXVII
    @MarvelousLXVII Рік тому +1

    Great video.

  • @kadeus
    @kadeus 11 місяців тому

    Great video really thx pls do more with Core data and Custom Calendar

  • @user-gr5tw8jk2p
    @user-gr5tw8jk2p 9 місяців тому

    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 🇮🇳

  • @oninizer
    @oninizer 7 місяців тому

    So helpful! Thank you!

    • @Indently
      @Indently  7 місяців тому

      Glad it was helpful!

  • @DS3CUR1TY
    @DS3CUR1TY 11 місяців тому

    Thanks Bro 💯🙏🏻

  • @WilfClegg
    @WilfClegg 4 місяці тому

    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!

    • @Indently
      @Indently  4 місяці тому

      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 :)

    • @WilfClegg
      @WilfClegg 4 місяці тому

      @@Indently My pleasure, in deed. If I was continuing my Python development, I would follow your Python videos, also! Be well.

  • @ChristianLawrence
    @ChristianLawrence Рік тому

    Great tutorial, thanks for making. Have you done a tutorial of interacting with an online service for data?

  • @andrejkling3886
    @andrejkling3886 2 роки тому +2

    Thank you…

  • @MarvelousLXVII
    @MarvelousLXVII Рік тому

    Thanks!

    • @Indently
      @Indently  Рік тому +1

      I really appreciate the support, thank you mate!

  • @RawanOmar-zn2qm
    @RawanOmar-zn2qm Рік тому

    thankssssssssssss

  • @gerdausdembergischenland4998
    @gerdausdembergischenland4998 2 роки тому +3

    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

  • @Memes_uploader
    @Memes_uploader 11 місяців тому

    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()

  • @iowint2298
    @iowint2298 11 місяців тому

    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

  • @SwiftDeveloperWorld
    @SwiftDeveloperWorld Рік тому +2

    why didn't you use ".environmentObject(dataController) " modifier?

  • @karenghara9383
    @karenghara9383 Рік тому +1

    top

  • @azamsharp
    @azamsharp Рік тому

    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!

    • @Indently
      @Indently  Рік тому +1

      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!

    • @azamsharp
      @azamsharp Рік тому

      @@Indently Thanks for wonderful videos.

    • @bi0hazardd144
      @bi0hazardd144 Рік тому

      @@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!

  • @LoganDavinci
    @LoganDavinci Місяць тому

    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)

  • @pierremarais7669
    @pierremarais7669 Рік тому

    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

  • @TheFistRZ
    @TheFistRZ Рік тому

    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"

  • @TimestampMaster
    @TimestampMaster Рік тому

    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?

    • @TimestampMaster
      @TimestampMaster Рік тому

      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

  • @SwiftDeveloperWorld
    @SwiftDeveloperWorld Рік тому +1

    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?

  • @LanPodder
    @LanPodder Рік тому

    Isnt DataController just the equivalent of a Repository in spring boot?

  • @hartleydeviations
    @hartleydeviations Рік тому

    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?

  • @maryannadelman4438
    @maryannadelman4438 11 місяців тому

    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.

  • @philippeberl897
    @philippeberl897 Рік тому

    How can I populate the database with data? I only want to edit it and run the app with pre-loaded data.

  • @SOK-gn6hw
    @SOK-gn6hw Рік тому +2

    when we edit food time shouldn't change

  • @rparham1997
    @rparham1997 Рік тому +2

    Getting error "Food not found in scope"

    • @timqiq
      @timqiq 11 місяців тому +2

      Restart Xcode.

  • @jarvix27
    @jarvix27 2 роки тому +1

    hey bro I need a reddit bot can u make that I will pay

  • @qianqian888
    @qianqian888 Рік тому

    very helpful to me, thank you very much~

  • @kickedanon
    @kickedanon 2 роки тому

    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?

    • @Indently
      @Indently  2 роки тому

      I think you can just remove the default value of banana from your data model and it should provide nil if there's nothing