iOS 13 Swift Tutorial: SwiftUI and Core Data - Build a To-Do List App

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 124

  • @JN-wj5tj
    @JN-wj5tj 4 роки тому +33

    There's a plethora of SwiftUI how-to videos and sites, the bulk of which are incomplete, wrong, or poorly made presenting half-baked solutions. Brian's videos are thorough with a great amount of knowledge shared. Thanks Brian!

  • @cementerioclub_86
    @cementerioclub_86 4 роки тому

    Rock Solid, thanks! Actually a lot of the code you write, now comes default in Xcode 12

  • @simonbachmann2120
    @simonbachmann2120 5 років тому +3

    Great tutorial thank you! I'd love to see an advanced tutorial on core data where you deal with many-to-many relationships, update data and query only a subset of items from the core data.

  • @erichsnijder7376
    @erichsnijder7376 4 роки тому

    Very nice tutorial.
    Saves me a lot of work to make the app working :)
    Keep up the good work :)

  • @govindsuryawanshi9052
    @govindsuryawanshi9052 4 роки тому

    Really awesome video made for core data along with swift UI

  • @hcri
    @hcri 5 років тому

    YOU ARE MY CHAMP. I did not have a chance yet, but I will be viewing it this week

  • @samabdollahian9841
    @samabdollahian9841 4 роки тому

    Love it keep up the good work Brian.

  • @nicolinden
    @nicolinden 4 роки тому +1

    Very good tutorial and I like the way you use this extension for the FetchRequest 👍🏼 One question though, I did some trainings on Core Data and on fetching and decoding JSON data now but I love to see an tutorial on fetching JSON and storing it in Core Data (preverably with more then one entity with a relation). Do you have such a tutorial or plan to make one in the near future? In any case, thanks again man! Very clear tutorial

  • @cappuccinopapi3038
    @cappuccinopapi3038 4 роки тому

    Thank you thank you for explaining what you were doing while you were doing it ! Thank you

  • @TheKingsMindset
    @TheKingsMindset 5 років тому +2

    Do more more more Swift UI tutorials!!!!!

  • @kelvinsmith4894
    @kelvinsmith4894 5 років тому +2

    Please, I have looked everywhere on how to properly change NavigationView/List background Color in SwiftUI, Thanks to Brain for another wonderful tutorial.

  • @TriMontana
    @TriMontana 5 років тому

    This is an excellent video. Very helpful.

  • @scottgilliland2061
    @scottgilliland2061 4 роки тому

    Excellent video, a very well done tutorial. Had to pause a few times to let stuff sink in, but that’s my brains limitation, not a fault of yours :). SwiftUI looks to be pretty powerful, and the more I learn about core data the more I like it.

  • @kenj1dev686
    @kenj1dev686 4 роки тому

    Well content with cool explanation, thanks bro

  • @martinkowollik1432
    @martinkowollik1432 3 роки тому

    Cool stuff. Thanks Brian.
    I think I understood how to add and delete an item. But how to modify an item, e.g. in the same view which I use for adding items? I cannot realize a cancel button to abort the modifications I already typed into the field. Any help for me? Rgds, Martin

  • @xxThemoritzxx
    @xxThemoritzxx 5 років тому +3

    Thx for this amazing tutorial. Would Love to See an App which is communicating with the Apple Watch, maybe as an Extension on this App. Keep up the good work.

  • @amit1922003
    @amit1922003 5 років тому +1

    Thank you Brian for another amazing tutorial🙏

  • @andrevdw747
    @andrevdw747 4 роки тому

    Thanks for the tutorial!

  • @phoelapyae4206
    @phoelapyae4206 5 років тому

    This is really cool. U r so brilliant. I think this is the big help to know about CoreData and SwiftUI. I appreciate it. Ive been waiting to watch ur brand new tutorials. 🤗🤗🤗

  • @xilluminati
    @xilluminati 3 роки тому

    How would you implement the EditButton() for a UITableViewController? I can't find any documentation on that, so if you could help out it would be really apprecited! Keep up the great videos

  • @TorstenRichterZH
    @TorstenRichterZH 4 роки тому +1

    Great stuff!! I like it and helped me a lot to get a quick understanding. Is the preview crash fixed (after adding the fetch request)? Would be great to see it in the preview together with coredata!

  • @umayangaalahakoon
    @umayangaalahakoon 5 років тому +3

    Hey Brian, thanks for this video.
    This tutorial is crazy useful.
    But I need some help.
    In my use case, I have to put the TextField below the ForEach (Just switch the places of TextField and ForEach).
    Now, whenever we add a new ToDo item, the TextField goes down (Just like Apple’s Reminders app).
    If the app has many toDo items, the keyboard covers the TextField when the keyboard appears and we can’t see the TextField.
    What I want to know is how to automatically scroll the List ( move the view up) to see the TextField when keyboard appears.
    Please help me.
    Thanks for reading my long comment. Have a great day.

  • @bhubryan596
    @bhubryan596 3 роки тому

    I don't have the same file system you do, so it is impossible to proceed. I think it is good idea to mention which Xcode Version you using. I am using Xcode version 12.4.

  • @JN-wj5tj
    @JN-wj5tj 5 років тому +1

    Great job! Thank you!

  • @kamiarcoffey5378
    @kamiarcoffey5378 4 роки тому

    Brian -- can you also show how to do this using a ViewModel architecture?

  • @lfatx
    @lfatx 4 роки тому

    Very good, thanks a lot!

  • @bibochip1
    @bibochip1 4 роки тому +3

    I already do like above, but my simulator just display a blank screen?

  • @anandsunku
    @anandsunku 3 роки тому

    Do you have any tutorial for storing a simple file on iCloud Drive folder using filemanager

  • @victornoagbodji
    @victornoagbodji 4 роки тому

    greatly appreciated 🙏 🙏

  • @jta7
    @jta7 4 роки тому +6

    I am so confused. My code looks exactly the same to yours but on line 43, I’m getting an error saying ‘Font’ is not convertible to ‘Font?’

    • @praetoriancze
      @praetoriancze 4 роки тому +1

      Same problem here...

    • @cybersecurityg3088
      @cybersecurityg3088 4 роки тому +1

      @@praetoriancze Update** Watching the video a fourth time I noticed I'm using an updated version of Xcode 11.3.1, and it adds extra code in the SceneDelegate.swift. I'm still researching what effect this would have on the code** I've run into the same issue, I haven't been able to find the solution yet unfortunately :(

  • @themidnightbeep
    @themidnightbeep 4 роки тому

    Thanks for the great tutorial! :D

  • @SteemeX
    @SteemeX 5 років тому

    Cool as always! Thank you

  • @sumupitchayan
    @sumupitchayan 4 роки тому

    Awesome video, short and to the point -- thank you! One question: Is there a particular reason why you embeded the VStack of the title and createdAt Texts for the ToDoItemView inside of a HStack?

  • @shonifari5783
    @shonifari5783 4 роки тому +1

    22:47 This is a Great tutorial and if u had the same problem as me here I found the solution
    The problem was that my ForEach was working and display as many rows as elements in my CoreData Model, but each label was set with the first element.name .
    So the values were there but the loop didn't iterate properly.
    The solution is that in the example above, you need to change "ForEach(self.toDoItems)" to " ForEach(self.toDoItems, id: \.self)".
    IIwasn't required at the time the video was recorded or it might be that my structure requires it.
    Nevertheless this tutorial is still one of the most complete on the topic and if you found my same problem, hope my comment can help you! much love people

  • @joeekadi
    @joeekadi 5 років тому

    Man, thank you so much! You are very very appreciated my brother. Much love

  • @klhmia
    @klhmia 4 роки тому

    You had me... until you wrote that "ToDoItem" function, Jesus. Things like that intimidate me and make me question if I'm even smart enough for this.
    Either way, great video and everything was definitely well explained - I just need to learn a little more Swift / Xcode before biting off more than I can chew I think, lol.

    • @BrianAdvent
      @BrianAdvent  4 роки тому

      Hey Karsen, you are definitely smart enough and absolutely right. If you are a beginner, CoreData can be a little bit intimidating because of all the new terms and concepts that you need to deal with. But keep pushing and you’ll get that hang of it!

  • @toastrecon
    @toastrecon 5 років тому +5

    Strange. I get the error:
    Value of type 'NSManagedObject' has no member 'createdAt'
    Value of type 'NSManagedObject' has no member 'title'
    On the "ToDoItemView" line in the ForEach loop. Any ideas? The add button works, and the number of to-do's increases, but that one piece isn't working.

    • @mikaelwillsmusic
      @mikaelwillsmusic 5 років тому +1

      I have the same issue

    • @tksb4288
      @tksb4288 5 років тому +1

      Same here. macOS 10.14.6, Xcode 11.0 (11A420a)

    • @JellyLancelot
      @JellyLancelot 4 роки тому

      Saaammmeeeee

    • @JellyLancelot
      @JellyLancelot 4 роки тому

      stackoverflow.com/questions/59061270/swiftui-foreach-of-fetchedresults-gives-the-error-value-of-type-nsmanagedob

    • @R29Future
      @R29Future 4 роки тому

      CoreData in SwiftUI tutoríal : ua-cam.com/video/X2qeZj0Xzrs/v-deo.html

  • @wilfriedschulze9015
    @wilfriedschulze9015 4 роки тому +3

    your tutorial is really great. I tried your To-Do List App with Core Data, it works very well. But then I tried to work with Core Data using the cloud kit. I just marked the Core Data in Cloud Check (creating the App). Now I have the problem the App will not work, because there is a crash in beginning the app. I get a signal SIGABRT in the second line of ContentView (the line with @FetchRequest(fetchRequest ...) Is there anything else to change to store the data in the cloud?

    • @bryceshaddix9179
      @bryceshaddix9179 4 роки тому

      having this issue too

    • @Nik6644
      @Nik6644 4 роки тому +1

      stackoverflow.com/questions/62676987/could-not-cast-value-of-type-swift-optionalswift-anyobject-to-nsfetchreques found this on stackoverflow. You have to add @objc(ToDoItem) above the class declaration of ToDoItem

    • @axtrock
      @axtrock 4 роки тому

      @@Nik6644 Genius!

    • @easytutorials92
      @easytutorials92 4 роки тому

      @@Nik6644 bro you saved my life

  • @VictorKushnerov
    @VictorKushnerov 5 років тому

    Thanks for your useful tutorial. Could you add some example how to use onMove handler with new Core Data feature?

    • @robertdesaegercto3043
      @robertdesaegercto3043 5 років тому

      stackoverflow.com/questions/57426250/modifying-a-fetchrequest

    • @VictorKushnerov
      @VictorKushnerov 5 років тому

      ​@@robertdesaegercto3043 I'd like to see code that changes the order of items.

  • @juliexie2007
    @juliexie2007 5 років тому +1

    The tutorial is wonderful! Very easy to follow. Thanks!

  • @gaetanocerniglia2635
    @gaetanocerniglia2635 5 років тому +2

    Having a reference of the model inside the ContentView (controller) is not agains a clean architecture?

  • @lostcrouton5342
    @lostcrouton5342 4 роки тому

    Hi Brian, really appreciate the video. I'm not used to the view having direct access to a database service (context). Not sure what a good structure is for SwiftUI apps. I'm currently trying to use a MVVM structure.

  • @guruitcompany
    @guruitcompany 5 років тому

    Thank you very much 👍

  • @labeshbaral1391
    @labeshbaral1391 4 роки тому

    Hey I was trying to make this into a tab in one of my tabbed views but I don’t know what I have to change I the root hosting to do that

  • @GRATCHNAT
    @GRATCHNAT 4 роки тому +1

    Xcode 11.5 - it is not necessary to modify SceneDelegate.swift, context and contextView are defined.
    If you are bothering with the dysfunctional preview, see stackoverflow.com/questions/59514875/swiftui-coredata-crashes-preview .
    If you want to use the folding ability of Xcode: Menu - Editor - Code Folding - Fold, and there you also find the keyboard shortcuts
    Foremost, THX!

  • @igr1s69
    @igr1s69 5 років тому +1

    great thanks you, how you think when all will start use swiftui?

    • @voxel8606
      @voxel8606 5 років тому +1

      I will use it today. But I recommend to use it only if you don't need backwards compatibility and have fun fixing a lot of bugs and changes over the years. But useable is it right now (kind of you need to mix it with UIKit). If you don't want to use it today I think you should wait 1-2 years

  • @atheers1448
    @atheers1448 5 років тому

    Your tutorials a very good and I really appreciate them however it's really annoying that sometimes I got to pause the video and zoom the page so I could see what you are writing or choosing, would be really awesome if could sometimes zoom when writing code or in general just make it a bit more zoomed like you. Thx anyway :)

  • @seungjunlee00
    @seungjunlee00 4 роки тому

    IDK why this is happening, but when I add a new task, unlike your video, the new row is being added upper the previous row, not beneath the last row.
    I have been keeping watching this video again and again what mistake I made, but still can't find it...
    Can someone drop me an idea or words that might be causing this error? Thanks;)

  • @sermedix
    @sermedix 5 років тому +1

    Thanks for this guide, can you insert one with the integration of a search bar to filter the data in Core Data?

    • @rebeloper
      @rebeloper 5 років тому +1

      You will need UIViewRepresantable for that

    • @sermedix
      @sermedix 5 років тому

      I would like to completely eliminate the dependencies on UiKit :(

    • @sermedix
      @sermedix 5 років тому

      I try with: ForEach(users.filter { self.serchedText == "" ? true : $0.name.localizedCaseInsensitiveCompare(self.serchedText) }, id: \.self) { user in... but gives me an error

    • @rebeloper
      @rebeloper 5 років тому +1

      @@sermedix Unfortunately there are some UIKit elements that one will have to use in a SwiftUI project, but I'm sure the SwiftUI team is working hared on bringing us into the future, where all things will be made with SwiftUI magic 🧙‍♂️

  • @kidrahoul
    @kidrahoul 5 років тому +2

    any github repo to see the code?

  • @ecptavares
    @ecptavares 5 років тому

    Brian thank you for the video.One question why do you have to put .navigationBarTitle on the curly braces of the list instead of the last curly braces of the navigationview that's where makes more sense since the title is to be set to the navigation view and not the list? thank you

  • @GreenDevBabe
    @GreenDevBabe 4 роки тому

    Cool that can delete. But can’t mark as done (strike and another color)

  • @b0red7
    @b0red7 4 роки тому

    hey ... random question ... how can you make a clone of notion or taskade.com ?

  • @simonbachmann2120
    @simonbachmann2120 4 роки тому

    If you want to change an item in the ToDoItemView (lets say the title), it is not reflected in the UI. Even though it is stored in CoreData. You have to somehow bind the toDoItem in order to see the changes. How would you do that?

  • @saadaldosary6711
    @saadaldosary6711 4 роки тому

    hey brain, thank you for your tutorial its substantially helpful. i have a problem here with the app, so it keeps crashing for this reason" could not cast value of type 'Swift.Optional' (0x7fff89e42578) to 'NSFetchRequest' (0x7fff89e42618)". i tried to lookup solution or updates but couldnt find any! help me please.

    • @alexandreguichet182
      @alexandreguichet182 4 роки тому

      This might help stackoverflow.com/questions/53690712/no-nsentitydescriptions-in-any-model-claim-the-nsmanagedobject-subclass

  • @noahrivas3955
    @noahrivas3955 5 років тому

    Can you do a tutorial on Bluetooth with SwiftUI?

  • @vipm
    @vipm 4 роки тому

    I'm getting a "Failed to call designated initializer on NSManagedObject" warning.

  • @danielwatson6529
    @danielwatson6529 4 роки тому

    how do we use previews when using core data?? im baffled 🤪

  • @dschulian
    @dschulian 5 років тому

    Hi Brian, thanks for your amazing tutorials! I used your video(s) as a guide to set up a very basic watchOS 6 application with Core Data support. However, I ran into very weird issues, like I'm unable to set the managedObjectContext once at the ContentView level (inside ExtensionDelegate), and then use it later on in sub views (Context in environment is not connected to a persistent store coordinator).
    Would highly appreciate any advice. Thanks!

  • @MrGetoutside
    @MrGetoutside 5 років тому

    what is the difference between a view controller and a content view I am confused if I have to use a content view instead?

  • @frankfernandez1957
    @frankfernandez1957 4 роки тому

    I got that error yesterday after implementing an environment object to my view. the way I fixed it was passing an environment object to the preview. Maybe if you pass a nsmanagedobject the canvas will work..?

  • @iambenmitchell
    @iambenmitchell 5 років тому

    Hi Brian,
    Thank you for the tutorial. I was wondering if you could update your "Complex SwiftUI" tutorial for Xcode beta 5. It became broken in beta 3. I have been trying to fix it for the last few weeks but I am new to this and I can't figure it out.

  • @Ryan-sr9zv
    @Ryan-sr9zv 4 роки тому

    How does this fit the MVVM pattern?

  • @nursultanyelemessov480
    @nursultanyelemessov480 5 років тому

    How to add a max length for a UITEXT FIELD in SWIFT UI (i mean in this course)?

  • @xxThemoritzxx
    @xxThemoritzxx 5 років тому

    As I was building this by myself, I encountered a problem. With Core Data, everything works fine. But how can I add a WebRequest with the URL Session to this project?
    Maybe you could help me archieve this withhin the already existing "FetchedResults" and "Fetchrequest".
    Best regards

  • @jersey-dude
    @jersey-dude 5 років тому

    In creating the ToDoItem.swift file, I get plenty of errors stating that it is a redeclaration of the class. I found that adding the data model to core data, it creates this class with this name. So I guess we dont need to do that? Only thing is, I can't create the extension. not sure why. If I comment out the class and just add the extension, I get the message that I am using an ambiguous use of fetchRequest().. UGH
    If I dont, however, use the same entity name, all seems OK..

  • @angryapple1882
    @angryapple1882 5 років тому

    Hi Brian, great video by the way. I have a question. I am creating an app that can save passwords, but I don’t want to use Firebase. what it does it saves the passwords on the iPhone. Would Apple allow this?
    Thanks,
    Amez

    • @iambenmitchell
      @iambenmitchell 5 років тому

      That seems like a horrible idea. Can't you use keychain?

    • @angryapple1882
      @angryapple1882 5 років тому

      Ben Mitchell I dont want to use anything thats on the icloud or online

    • @iambenmitchell
      @iambenmitchell 5 років тому

      Apple would not allow this unless it was encrypted. Even then, they probably still wouldn't let it in the App Store. Use it for personal use

    • @angryapple1882
      @angryapple1882 5 років тому

      Ben Mitchell so basically what I have is an app that you need a password to enter to access a text doc to add your passwords

  • @danielwatson6529
    @danielwatson6529 4 роки тому

    OOh, how do you do that foldy thing? Ive googled foldy thing and got nothing, confused the hell out of me when you did it!

    • @James-pj6cg
      @James-pj6cg 4 роки тому

      Click on the editor menu and go to code folding, Or press "option + command + left arrow key to fold" and right arrow key to unfold

    • @danielwatson6529
      @danielwatson6529 4 роки тому

      James my guy! thanks buddy

  • @erichsnijder7376
    @erichsnijder7376 4 роки тому

    Question: Why is het unsafe to unwrap the title en createdAt when showing it in de section with ToDoItemView.
    Hope you understand what i mean.

  • @joannes86
    @joannes86 5 років тому +1

    I'm sure if you redo this tutorial following your video you will discover errors in cutting the video because the code is missing

  • @adamkenton2585
    @adamkenton2585 5 років тому

    Nice tutorial, could you explain what the scene delegate file is for ?

  • @famillefournier1085
    @famillefournier1085 5 років тому +1

    Nice, but... please bump up the font or reduce the resolution.

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

    When following along, at 5:15 when defining a new public class, users get an 'Invalid Redeclaration' error. You skipped all explanation of how and why we are avoiding a redeclaration here. Many other examples of shallow and useless explanations. The video description begins with "Learn how to..." For a user wanting an actual tutorial to understand and not just be shown, this video falls short.

  • @DOnjaman101
    @DOnjaman101 5 років тому

    I'm new to coding and when follow your tutorial the app crashes when i try to delete an object. I went over it many times and get the same result. Maybe I'm missing something?

    • @rebeloper
      @rebeloper 5 років тому

      Please provide the steps that let to the crash and the actual log of the crash from the console. If it's too long than you should try posting it on stackoverflow

  • @colinmcdonnell5571
    @colinmcdonnell5571 5 років тому +1

    Does anybody know how to create a countdown app using swiftUI?

    • @rebeloper
      @rebeloper 5 років тому

      It's pretty easy. Contact me to show you how.

    • @colinmcdonnell5571
      @colinmcdonnell5571 5 років тому

      Rebeloper - Rebel Developer how would you like me to contact you?

  • @eashanmathur2030
    @eashanmathur2030 4 роки тому

    Video starts at 1:50

  • @TNT46710
    @TNT46710 5 років тому

    TextField("ааа", text: self.$newToDoItem)
    Type of expression is ambiguous without more context
    Any thoughts?

    • @R29Future
      @R29Future 4 роки тому

      CoreData in SwiftUI tutoríal : ua-cam.com/video/X2qeZj0Xzrs/v-deo.html

  • @sheevBL
    @sheevBL 5 років тому

    19:39 how you did it?

    • @iambenmitchell
      @iambenmitchell 5 років тому

      You need to enable it in preferences

    • @R29Future
      @R29Future 4 роки тому

      CoreData in SwiftUI tutoríal : ua-cam.com/video/X2qeZj0Xzrs/v-deo.html

  • @mkhasson97
    @mkhasson97 5 років тому

    🎊✌🏻️ 1st

  • @Fuzti13
    @Fuzti13 4 роки тому

    Well it is basically not a tutorial.

  • @tommedhurst6366
    @tommedhurst6366 4 роки тому

    No apostrophe in To-Dos, shouldn't be "ToDo's"; however, "Whats Next" should be "What's Next" ;)

  • @arturo7392
    @arturo7392 5 років тому +1

    Dude you are just showing but not explaining what is what...

    • @R29Future
      @R29Future 4 роки тому

      CoreData in SwiftUI tutoríal : ua-cam.com/video/X2qeZj0Xzrs/v-deo.html

  • @jersey-dude
    @jersey-dude 5 років тому

    Great job! Thank you

  • @MrGetoutside
    @MrGetoutside 5 років тому

    what is the difference between a view controller and a content view I am confused if I have to use a content view instead?