iOS 15: How to combine Core Data and SwiftUI- Bookworm SwiftUI Tutorial 3/10

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024
  • Download the completed project here: github.com/two...
    Other parts in Project 11:
    Introduction: www.hackingwit...
    1. Creating a custom component with @Binding: • iOS 15: Creating a cus...
    2. Accepting multi-line text input with TextEditor: • iOS 15: Accepting mult...
    3. How to combine Core Data and SwiftUI: This video
    4. Creating books with Core Data: • iOS 15: Creating books...
    5. Adding a custom star rating component: • iOS 15: Adding a custo...
    6. Building a list with @FetchRequest: • iOS 15: Building a lis...
    7. Showing book details: • iOS 15: Showing book d...
    8. Sorting fetch requests with SortDescriptor: • iOS 15: Sorting fetch ...
    9. Deleting from a Core Data fetch request: • iOS 15: Deleting from ...
    10. Using an alert to pop a NavigationLink programmatically: • iOS 15: Using an alert...
    Wrap up and challenges: www.hackingwit...
    You can find the full set of videos, along with transcriptions, challenges, tests, and more, in my free 100 Days of SwiftUI course: www.hackingwit...
    Watch the full 100 Days of SwiftUI playlist here: • Hacking with iOS: Swif...

ความคิดเห็น • 50

  • @andycouto7688
    @andycouto7688 ปีที่แล้ว +4

    for anyone getting an error from xcode saying "cannot find type 'Student' in scope" try cleaning your build folder, derived data, close and reopen Xcode.

    • @maryannadelman4438
      @maryannadelman4438 ปีที่แล้ว

      Tried that. Didn't work. And getting other errors too even though I followed tutorial exactly.

  • @DavidNitzscheBell
    @DavidNitzscheBell 2 ปีที่แล้ว +2

    7:22 perhaps not super important, but you misspelled "description". Can't see (yet) where that variable gets used, but just in case....

  • @bobbrysonn
    @bobbrysonn ปีที่แล้ว +3

    This was perfect introduction to CoreData. Thank you.

  • @binwiederhier
    @binwiederhier 2 ปีที่แล้ว +4

    Fantastic explanation, without any fuzz and straight to the point. Thank you.👍

  • @schizofennec
    @schizofennec ปีที่แล้ว

    Every time i hit "Add" it is adding to the list: "Optional("Ron") Optional("Weasley")" Rather than "Ron Weasley"
    Possible bug with new xcode 15?

  • @ConfidentlyRong-jo5yt
    @ConfidentlyRong-jo5yt 4 หลายเดือนก่อน

    Quick question, with SwiftData being the new hotness should I still learn core data? Also thanks for all your videos, you're truly the best.

  • @ljunq
    @ljunq 8 หลายเดือนก่อน

    If you wanted to run something right after the loadPersistenceStore to set some values from the database for the application. I was thinking an @Published variable in the DataController but I don't know how to access it if it's being set like: .environment(\.managedObjectContext, dataController.container.viewContext)
    Do you have any thoughts on this?

  • @sergiocaplan1168
    @sergiocaplan1168 ปีที่แล้ว +1

    Strange question. When I follow this tutorial it crashes the "Preview", but runs well on the "Simulator" and any real iOS "device." I realize that the more complex code gets, the less reliable preview becomes. Just wondering if there's any sort of workaround to get the preview to be more resilient.
    Thanks for this lesson

  • @UrbaneHobbit
    @UrbaneHobbit 2 ปีที่แล้ว +4

    This is an excellent tutorial with a clear introduction of topics and (importantly) full explanation of functionality - both in terms of what elements are in use and what each one does. It takes me back to the original Ruby on Rails video tutorial, if anyone remembers that. This is exactly what I needed at this moment in my project, and I am excited to try this out.

  • @totalchrisgaming
    @totalchrisgaming ปีที่แล้ว

    Learning this because Xcode 15 Beta 4 has a glitch preventing me from using previews under SwiftData :(

  • @justsomegaming
    @justsomegaming 2 ปีที่แล้ว +1

    Why do we make DataController to conform to ObservableObject protocol? It has no @Published properties. Same question to usage of @StateObject when we create DataController.
    My project works on simulator without ObservableObject/@StateObject on simulator and real device, but when I check previews I get crashes: "executeFetchRequest:error: A fetch request must have an entity". And surprisingly when I return ObservableObject/@StateObject, then previews continue to work without issues. My view that was crashing on previews was using @FetchRequest... Are these things related: ObservableObject/@StateObject/the crash? Or is it just a coincidence that adding ObservableObject/@StateObject fixes previews as well?

    • @IanLeon
      @IanLeon ปีที่แล้ว +1

      I was asking myself the same question.
      I don't think it is actually necessary.

  • @genericasianboi
    @genericasianboi 10 หลายเดือนก่อน

    Can you use CoreData in swift playgrounds?

  • @BeosDoc
    @BeosDoc 2 ปีที่แล้ว +1

    🙂👍🏻. For macOS SwiftUI app that would have a table of rows and columns of data loaded from a flat file, that could have 1 to more than 20,000 rows. Would you do structs or core data to hold the information? The data doesn’t need a persistent store, since it can be exported with any changes made. Sorting, filtering and rearranging columns also needed. I’m concerned about responsiveness of the UI. Thanks

  • @ZoomerAction
    @ZoomerAction 2 ปีที่แล้ว +1

    Your tutorials never let me down. Thank you

  • @zyrustaferbr4403
    @zyrustaferbr4403 ปีที่แล้ว

    nao eh vc que ganhou 3 copa pistão

  • @krq999
    @krq999 ปีที่แล้ว

    Why is there's no `PersistenceController:ObservableObject` in the Persistence.swift when the code is generated(project with core data checkbox selected)?
    Is it observable by default without ObservableObject?
    Can persistenceController be placed in some higher order model like appstate?
    Thanks

  • @jaredsalzano
    @jaredsalzano ปีที่แล้ว

    How would I then use CoreData from AppDelegate without making a duplicate of the persistentContainer?

  • @saito_in_china
    @saito_in_china 2 ปีที่แล้ว

    I was looking for this for a thousand years . Everyone who is explain everything except this , and u dint understand how d hell should function .

  • @waytospergtherebro
    @waytospergtherebro 2 ปีที่แล้ว

    Core Data was introduced in 2005 long before the iPhone existed. It's been around even longer if you consider the fact that EOF was basically the same thing.

  • @thatpolodude
    @thatpolodude ปีที่แล้ว

    Thanks Paul, great content. Awesome teaching skills!

  • @nandolambrusco
    @nandolambrusco ปีที่แล้ว

    Thank you for this excellent introduction, very good explained

  • @arnoczkyzoltan6158
    @arnoczkyzoltan6158 ปีที่แล้ว

    Thank You!

  • @MASSILOULDMOHAND
    @MASSILOULDMOHAND ปีที่แล้ว

    Excelent

  • @Kasula23
    @Kasula23 ปีที่แล้ว

    Amazing Tutorial - Really very well explained

  • @SushiMonChicago
    @SushiMonChicago 2 ปีที่แล้ว

    Hi Paul
    can you create some example searchable using multiple objects like start date and end date for fetch filtering? Thanks You

  • @makermake295
    @makermake295 2 ปีที่แล้ว

    Why is the managed object context on line 11 allowed to not have a type associated with it? That's the only one I've ever seen without it

  • @VaderPepe
    @VaderPepe ปีที่แล้ว

    Thank you for this tutorial! Made the entire progress a lot more understandable!

  • @classenalex
    @classenalex 2 ปีที่แล้ว

    Easy to understand nice to follow, thanks for the video

  • @storyxc6740
    @storyxc6740 2 ปีที่แล้ว

    Thank you so much Paul ! it's the best tutorial i've ever seen.

  • @MauricioChavesDias
    @MauricioChavesDias 2 ปีที่แล้ว

    Thanks for the video, Paul!

  • @connorvantress8073
    @connorvantress8073 2 ปีที่แล้ว

    How do you use coredata text editors and text labels? Like notes style app

  • @enricobecker9126
    @enricobecker9126 ปีที่แล้ว

    This NSPersistentStoreCoordinator has no persistent stores (schema mismatch or migration failure). It cannot perform a save operation. How can I fix this?

    • @enricobecker9126
      @enricobecker9126 ปีที่แล้ว +1

      solved: delete the App from Simulator and Run again..

  • @izzzanaaami
    @izzzanaaami 2 ปีที่แล้ว

    Как же плохо, когда знаешь английский на начальном уровне

  • @amphortas1
    @amphortas1 2 ปีที่แล้ว

    Thank you very much for this amazing tutorial. I have a question: Could you create a tutorial how to initialise / populate Core Data, for example, if I would like to have 1000 English words with translation is ready to use?

  • @ClintonSiegel
    @ClintonSiegel 2 ปีที่แล้ว

    Grateful for your incredible instruction and teachings! Thank you!

  • @relax_music668
    @relax_music668 ปีที่แล้ว

    Thank you, it has taught me a lot,.👍

  •  2 ปีที่แล้ว

    Is core data, is love ❤️.
    Maybe You can do some like a virtual class-book - add student to class from search form, by line, and some stats of class (average grade, best score).
    That would be nice. I need some like this 😉

  • @afixithei.V
    @afixithei.V ปีที่แล้ว

    Good tutorial. Explanation is clear

  • @vahid_sayad
    @vahid_sayad 2 ปีที่แล้ว

    Isn't it a bad idea to write by viewContext?

  • @martinwolczyk891
    @martinwolczyk891 2 ปีที่แล้ว

    Thank you so much, your teaching style was extremely clear and useful to me! Brilliant

  • @henrikkurka2681
    @henrikkurka2681 ปีที่แล้ว

    Excellent tutorial!

  • @enricobecker9126
    @enricobecker9126 ปีที่แล้ว

    Awesome!!! Awesome!!!!

  • @AvantjerTube
    @AvantjerTube ปีที่แล้ว +1

    Regarding the fact that Swift and Core Data each have their own definition of "optional", I'd have to say that Core Data's use of the word is more in line with the traditional concept of something being "optional" as opposed to "required".
    I've always thought that Swift's use of the word "optional" was a poor choice.
    It is *not* in line with the traditional concept of something being "optional" as opposed to "required".
    This made learning about Swift optionals difficult for me because I was not able to map them to the traditional meaning of "optional".

  • @nat.serrano
    @nat.serrano 2 ปีที่แล้ว +1

    the best swift teacher on the planet, in the solar system, the Galaxy, the universe, the cluster universe, the matrix, the future metaverse

  • @mrslana3049
    @mrslana3049 2 ปีที่แล้ว

    I love you ! great! great! great!