iOS Swift Tutorial: App like Twitter with Firestore Cloud Database

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • ➡️ Basics video about Firestore: • iOS Swift Tutorial: Cl...
    In this tutorial you are going to create a simple app like Twitter. You will use the new cloud database Firestore from Google. You’ll learn how to add data, how to perform simple queries and how to listen for realtime updates.
    🛒 GAME DEVELOPMENT COURSE - JUST $20 🛒
    www.udemy.com/...
    👏 Support me on Patreon: / brianadvent
    🖥 www.swift-tutor...
    ➡️ Start files includes Podfile:
    bit.ly/2kj3TDP
    ➡️ Finished Project on Github:
    github.com/bri...
    ➡️ Web: www.brianadvent...
    ✉️ COMMENTS ✉️
    If you have questions about the video or Cocoa programming, please comment below.

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

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

    After days of working through using the documentation, you really drove these concepts home with this tutorial. Thank you much for your delivery of this information!

  • @juanerenas4662
    @juanerenas4662 5 ปีที่แล้ว +5

    Is this happening to anyone else?
    self.postArray = querySnapShot!.documents.compactMap({Post(dictionary: $0.data())})
    is returning zero results, but when I don't use Date, it goes through. Does anyone know why? Any response would be really appreciated.
    Also, great video Brian! Liked and subscribed.

    • @jellegeers5536
      @jellegeers5536 5 ปีที่แล้ว

      same problem over here

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

      Jelle Geers yeah don’t use Date, use Timestamp. That’s what Firestore uses.

    • @jellegeers5536
      @jellegeers5536 5 ปีที่แล้ว

      @@juanerenas4662 Thank you!

    • @ajhernandez
      @ajhernandez 4 ปีที่แล้ว

      same here, removed the date and it worked.

    • @seanlee1106
      @seanlee1106 3 ปีที่แล้ว

      @@juanerenas4662 Thank you so much!

  • @user-eg3gk6dw6d
    @user-eg3gk6dw6d 3 ปีที่แล้ว

    Oh my god. I like this. thank you for upload!

  • @veronikab__
    @veronikab__ 4 ปีที่แล้ว

    Superb!! Thank you so much for your video!

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

    flatMap is depreciated and is asking to use compactMap however that seems to be returning 0 results
    self.postArray = querySnapShot!.documents.compactMap({Post(dictionary: $0.data())}) is what I have * never mind, for some reason Date was giving me an issues.

    • @aaryanshroff
      @aaryanshroff 5 ปีที่แล้ว

      Same

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

      I'm having the same problem. sweetArray is empty after parsing the data from snapshots. What was your solution?

    • @codic1160
      @codic1160 4 ปีที่แล้ว

      @@veronikab__ did you find solution?

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

      @@codic1160 Yes. In extension in Sweet file you should handle each parameter separately, instead of using guard let statement for all 3 parameters. So you can see where is the problem. In my case problem was with timeStamp parameter. Handle each parameter like this: let name = dictionary["name"] as? String ?? "Error! Name Field Not Found!". I opened an issue on Stackoverflow, so you can read more here: stackoverflow.com/questions/62138964/the-data-from-firestore-database-is-not-displayed-in-the-tableview

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

    Could you please do one with sending photos???

  • @shxrpe3646
    @shxrpe3646 5 ปีที่แล้ว

    Thank you so much for the tutorial. So easy to understand, and works amazingly.

  • @JakeCrawfordOfficial
    @JakeCrawfordOfficial 6 ปีที่แล้ว

    Favorite firestore tutorial

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

    Hi Brian. Great tutorial, however, the finished project, as is, on Github is incomplete. The storyboard is blank, the app delegate file seems to be missing the configure statement for Firestore, etc. Also, could you clarify why you need a struct in addition to the dictionary layout of Sweet? I'm unclear why it is necessary. Finally, how does one go about updating an existing document using the dictionary structure? My attempts have hit against the problem of the dictionary not being settable, even when defined with var.

  • @techfuturist945
    @techfuturist945 4 ปีที่แล้ว

    great tutorial Brian!

  • @leroysalih
    @leroysalih 6 ปีที่แล้ว

    Fantastic Tutorial! Thank you very much.

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

    Hello. How would I go about implementing a feed that only shows “friends” or people the user is “following,” efficiently without duplicating data? Thanks!!

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

    Cool. Better then Firebase))) Thank you.

  • @sethmerritt9252
    @sethmerritt9252 6 ปีที่แล้ว

    Hey Brian..Your tutorials are very helpful to see the whole development process on these topics. The data nesting in Firebase seems different than what I am used to with SQL formats. Are you planning to do a tutorial with nested data in Firebase? Could you show us something maybe with users and their associated 'Sweets' as nested data?

  • @TheRuthlessEAZY
    @TheRuthlessEAZY 4 ปีที่แล้ว

    Nice video! Is there any chance you could create a version for swiftUI?

  • @RizosKonstantinos
    @RizosKonstantinos 5 ปีที่แล้ว

    Perfect Tutorial...

  • @mnc12004
    @mnc12004 6 ปีที่แล้ว

    Hey Brian,
    Thanks loads for this tutorial. Can you please show how to go from the table view to a detail view retrieving a document using document id form meta data?

  • @abdouett3676
    @abdouett3676 7 ปีที่แล้ว

    Great work! Thanks

  • @rafparistokyo8365
    @rafparistokyo8365 5 ปีที่แล้ว

    Hey thank you for this tutorial. It works like clockwork... can you show us on how to delete a sweet from the tableview or collectionview and more importantly from firestore... it seems that you need to delete with ID but i cant find how to get a sweet ID for deletion

  • @ramneekkashyap5701
    @ramneekkashyap5701 5 ปีที่แล้ว

    Very Good Video, thank you sir, I was looking for the solution since morning final got your right guidance, thank you very much, please keep up the more good work. Thank You once again

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

    Hi Brian! Amazing videoo. One question tho. Why do I get "Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value" when I add a new entry?? Please help

  • @reventon555
    @reventon555 4 ปีที่แล้ว

    at 09:00, using xcode 11, after creating the dictionary and protocol, I cannot initialize the structure. Xcode will not pull the parameters (i.e. name, content, timestamp)
    not sure if this is because i'm using the latest version

  • @shingetzu88
    @shingetzu88 7 ปีที่แล้ว

    Hi Brian, thank you so much for the tutorial. Really great! I have a question though. I don't understand why we need to do the protocol? Can we not do the initialization inside the struct? Why do it this way? Thank you.

  • @64darksparo
    @64darksparo 3 ปีที่แล้ว

    im getting "Cannot find 'indexPath' in scope" error , i try to control drag the table but still wont fix it. any idea how to fix this issue

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

    For some reason I actually imagined Jonah Hill teaching me this tutorial

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

    Hi Brian, I'm having trouble implementing the code in line 33 at 19:26. This is for my final year university project. Is it possible to get in contact with you for some help?

  • @ebrahimizx1979
    @ebrahimizx1979 7 ปีที่แล้ว

    Hello I enjoy watching your TH-cam channel.
    But I’m having a problem with sort and search bar with my firebase data

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

    hello Mr.Brian, i got a question regarding the firestore: within one application, can i use half of my database tables in old firebase realtime database, and half in new firestore, simply because they charged different by number of request and amount of data, if it is data heavy database i use firestore since is charged by request , and vice versa, can they interact or exchange data perfectly ? thanks

  • @user-vf1hg3mg7d
    @user-vf1hg3mg7d 5 ปีที่แล้ว

    Could you please add that you post photos???

  • @miriamfemerling8083
    @miriamfemerling8083 6 ปีที่แล้ว

    Can you make a video showing how to delete the "sweets" (really cute name) from both the array and the Firestore database?

  • @preydeath
    @preydeath 7 ปีที่แล้ว

    Firestore looks really great, but I just curios, do we need firestore while we have a firebase database? Because it's looks the same for me. I mean, we have offline support on firebase database too for example. Btw thank you for this great video :)

    • @conorcurley6798
      @conorcurley6798 6 ปีที่แล้ว

      Idk if you want the answer still, but Realtime Database and Firestore have their own advantages and disadvantages. You don't have to adopt it, but I find the syntax significantly more legible and easier to work with.

  • @mirjalolsirojiddinov3043
    @mirjalolsirojiddinov3043 5 ปีที่แล้ว

    'self' used before 'self.init' call or assignment to 'self xcode giving me that error on the last line of code. anyone can help?

  • @mcnimi
    @mcnimi 7 ปีที่แล้ว

    nice :)

  • @robertlee1824
    @robertlee1824 6 ปีที่แล้ว

    I managed to get everything working with the exception of the real-time updates listener. It only updates if I switch the simulator off and build and run again. Any thoughts on where to look to fix?

    • @robertlee1824
      @robertlee1824 6 ปีที่แล้ว

      All fixed I didn't call the checkForUpdates () function after loadData (). I was going through the tutorial so fast I missed it. Doh!

  • @AdamSmaka
    @AdamSmaka 6 ปีที่แล้ว

    12:55 - why do you initialize ref with nil first?

    • @conorcurley6798
      @conorcurley6798 6 ปีที่แล้ว

      Same reason he uses string interpolation when you just could use the variable name on its own. You might need to come back and change it in the future and doing it out like that makes it easier to change individual parts.

  • @CardinalHijack
    @CardinalHijack 7 ปีที่แล้ว

    wtf happened at 1:49 haha

    • @BrianAdvent
      @BrianAdvent  7 ปีที่แล้ว

      Thanks to you mate, this is going to be a secret now :) Just did some quick editing

    • @CardinalHijack
      @CardinalHijack 7 ปีที่แล้ว

      hehe :D

    • @markschacht2152
      @markschacht2152 7 ปีที่แล้ว

      Susan Boyle