Complete SwiftUI Firebase Tutorial: Auth, Sign Up Page, Cloud Firestore, Read & Write Data

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

КОМЕНТАРІ • 193

  • @logankoshenka
    @logankoshenka  2 роки тому +21

    Here is the code snippet for 03:30:
    extension View {
    func placeholder(
    when shouldShow: Bool,
    alignment: Alignment = .leading,
    @ViewBuilder placeholder: () -> Content) -> some View {
    ZStack(alignment: alignment) {
    placeholder().opacity(shouldShow ? 1 : 0)
    self
    }
    }
    }

  • @walterzz-d1y
    @walterzz-d1y 2 роки тому +26

    Some time small creator are more helpful than big creator thanks for the knowledge I really appreciate.

  • @SF-gn6uw
    @SF-gn6uw Рік тому +2

    My god it works…. Your voice is strong enough to carry this without background music

  • @NavdeepSingh-ut8md
    @NavdeepSingh-ut8md 9 місяців тому +2

    Great brother, such an important topic and you made it look so easy !!.

  • @thelambsauce2015
    @thelambsauce2015 2 роки тому +7

    This tutorial is very on point and straightforward. Thank you so much for this!

  • @SOK-gn6hw
    @SOK-gn6hw 2 роки тому +1

    i was subscribe another channels who are making videos about swiftui but after this video i delete them all !!
    Nice job.

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

    Hey Logan, fantastic tutorial. Also helps that my daughter and you share a great name!
    Hope to see more from you!

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

      No way! Happy to help!
      Just add .environmentObject(DataManager()) to your ListView() inside of your preview code!!

  • @wiktorwysocki516
    @wiktorwysocki516 2 роки тому +5

    Great tutorial, just what I was looking for! Thank you!

  • @ggmptv7904
    @ggmptv7904 9 місяців тому +1

    Amazinfg content, not boring, the code works and I applied what I learned to my own code and now understand what's going on a lot better! Thank you

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

      love that!! thanks for watching & commenting!!

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

    These videos are literally the most helpful thing i've come across, thank you for everything Logan

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

    Can you make a mini series on this, we would all love it!

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

      good idea! what else would you like to see?

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

      Man I wasn’t ready for this but here are a few
      1) How to make a mini game
      2) Going over your favorite third party programs that can be integrarte into XCode such as Rive, Google maps..etc
      3) How to add payment or subscription base app
      4) How to connect app to an website
      * I have look for this in UA-cam and haven’t found a good video yet. I like your videos and I think you can actually explain this in a way we can all understand

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

      awesome thank you!

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

    Thanks for the clear explanation! Firebase looks like a handy thing when you don't want to set up the backend

  • @jmd62800
    @jmd62800 10 місяців тому +1

    Fantastic, i really love it , it’s beautifull, well explained for my little brain , i understand 90% in one read, Very pleasant, i’am happy thanks a lot 😊

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

    Man, this video is gold ✨ Thank you so much, you made it so simple for me and it helped me so much, thank you so much. I subscribed. keep rocking 🍻

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

    Nice Video Logan, very easy to follow

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

    Amazing stuff, great job man!

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

    Very useful tutorial - and it worked! Just wish there wasn't any background music - bit distracting. But found the tutorial very helpful. Thank you.

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

    keep it up, This is really great! keep the good work going

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

    really appreciate your video man! great job taking the time and effort on this. awesome content

  • @mr.r3253
    @mr.r3253 2 роки тому +1

    Amazing.. someday this channel would be big

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

    Thanks for making these videos, Orlando, I've learned a lot.
    Totally weird that Legolas is doing SwiftUI videos, though ...

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

    King! Thanks so much for this awesome tutorial, helped me so much :D

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

      glad you liked it!

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

      @@logankoshenka One question, what goes in the else statement in the var body: some View { in ContentView?

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

      my code has:
      var body: some View {
      if userIsLoggedIn {
      ListView()
      } else {
      content
      }
      }
      (with "content" containing everything inside of the ZStack)

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

      @@logankoshenka Awesome, tysm!

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

    You made it so easy!

  • @AlexanderWebster_
    @AlexanderWebster_ 5 місяців тому +1

    Hey! Really appreciate the video. How are you highlighting view frames in your preview?

    • @logankoshenka
      @logankoshenka  5 місяців тому +1

      I know it’s changed since the video but I’m pretty sure you still can - click on the container in code while preview is on the cursor-highlighted mode (not the play button but the cursor) … might have to play around a bit but I think that should do it

  • @Pete-ek9dw
    @Pete-ek9dw Місяць тому

    omg, You are really a genius!!!!Thank you sooooooo much
    😁

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

    First thank you for this video! Things are starting to sink in, then I got to about 21 min in and was confused by code I haven't seen before. I looked to firebase documents to explain and define what's happening with these lines and words and can't seem to find a straight forward answer, so I was wondering if you had a certain link in mind when you said to look there that you might share. Thank you so much.

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

      you should be able to read all about Firebase Firestore here! firebase.google.com/docs/firestore

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

    Great content and easy to understand

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

    Great video!!
    I suspect that no matter what user signs into the app, the list would always be the same. Can’t find a way to link data to specific users, so that for example each user has their own specific list of dogs. If you could point me in the right direction I’d appreciate it!

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

      Of course - imagine an app where a user has friends or followers. All you would need to do is save that user’s list ID under “User” in firebase … when you load, you can fetch a list specific to them :)

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

      @@logankoshenka Let's say I want to make the same app except every user has its own dogs. Can I just retrieve the user ID every time I login and each time I save a new dog I just add a field like "owner_id" as if it was a relational db? So I can show the user only the dog whose owner_id is equal to his id. Or is it done in another way? I'm new to noSQL, thanks in advice :)

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

    we need part 2, more deeper one, with auto generated id (UUID)

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

    Do you by chance have a video explaining the extension that you added. I'm still new to SwiftUI, so I wasn't able to make sense of the code, and would like to.

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

      that extension is just so that we can have a placeholder for our text field ... it is a bit hacky, and I found it quickly when looking for a solution ... but the function returns a ZStack with the placeholder ... the placeholder also takes in some custom parameters (shouldShow: Bool, alignment: Alignment)

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

    Love to see your channel growing ! 😊
    Don’t forget me when your channel hits 100k landmark !

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

    Nice video, How do you represent custom object array in firebase cloud database?

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

    Good tutorial… thank you

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

      thanks!

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

      @@logankoshenka struct Dog should conform Hashable and in ListView for Each id:\.self. In addDog function we don't need for setData id : some Int. In this case we create in list view new name of Dog... Before with ForEach id:\.id data appear only in Firebase but in List View data appeared with same name for id : 12.

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

      you’re right - good catch!

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

    What’s your take on encapsulating your firebase logic in a service class? then instantiating in your view

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

      a common approach! just a matter of a personal preference :)

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

    Nice....great video

  • @phongho.design
    @phongho.design Рік тому +1

    do u have a video for when user clicking on forget password in welcome screen ?? 😂

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

      I don't but it's pretty simple to set up using Firebase documentation! Check out the section titled, "Send a password reset email" here: firebase.google.com/docs/auth/ios/manage-users

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

    Hey, when I make multiple entries using the plus button it just uses the first one I make over and over. Example if I add a dog breed named "Dog" and make another one named "Dog 2" it'll be "Dog" "Dog" in the list instead of "Dog" "Dog2".

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

    Hi this tutorial is awesome thank you!! How would you have the app update the data that's updated in the DB in real time? Would there be some loop that's running, or something that can watch it every minute it or so to trigger a function? Sorry I'm a noob but just thinking of how it could be done! Thank you for the immense help!!

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

      no you’re fine! so most times you can read / write from your database based on a user’s action (save button, post button, tapping on a new screen to fetch data) … you can use the .onAppear method to call when your view appears, AND you can make your list refreshable to re-fetch that data … so it’s really just whatever best fits your situation 👍

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

    I’m a beginner iOS developer, self taught. May I know how I became like you that so easy to creating what you want? What is the best tutorial to learn?

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

      haha just do a bunch of them! It just takes time!

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

    Would you be willing to set up a tutorial for a sign out function, I seem to be stuck at the original log in which never prompts my log-in again? Great video otherwise!!!

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

      I should have covered that! Deleting the app from the device's home screen resets the behavior. In the mean time, this may be helpful too: stackoverflow.com/questions/37943616/firebase-sign-out-not-working-in-swift

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

      @@logankoshenka I had to run a demo on it so what I did was create a new database and couldn't revert back to a log in screen I made following this instruction. I have to create a signOut function to create a full circle with this database in the weeks to come hopefully this stack overflow page can guide me to the final product! Thank you

    • @ItsIan.
      @ItsIan. Рік тому

      @@logankoshenka Even after deleting the ap from the devices' home screen the user seems to stay logged in, have you had any issue with this?

    • @ItsIan.
      @ItsIan. Рік тому

      I guess that's from the $State portion of it retaining the information afterwards. Thanks for the video!

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

    Great job thanks for the tutorial

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

    great vid, is their a way to fetch the users location and home address?

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

      location yes, in the form of coordinates ... look into tutorials like "swiftui mapkit" or "swiftui user location" ... you'll need to ask the user's permission first for privacy though! (also - firebase analytics can show you which countries your users are from)

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

    Great tutorial. Can you please share a link to the code / github?

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

    Hello Logan. Very informative video! However I was wondering if you could help me with a certain problem: At 15:35, you create an if statement to see if the user is logged in. However, when I do this and run my simulation, it doesn't go to the "content" variable, but rather to where the function it sends it to if I'm logged in.

    • @TylerP-eu2gj
      @TylerP-eu2gj Рік тому +1

      This tutorial handles this incorrectly. Try refactoring the state toggle to the login function.

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

    Hey Logan, great video, wondering if I could have a hand on turning the List(environmentobject.variable) to a ForEach loop, thanks :)

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

      sorry for the late reply - List and a Stack / ForEach combo are pretty interchangeable! what are you trying to do?

  • @whoisnoni
    @whoisnoni 6 місяців тому

    is it ok to help me in my graduation project ? we made it with Swift storyboard , is everything works on it ?

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

    I see everybody using hardcoded values for frames and offsets etc, won’t that have unpredictable results on different devices and resolutions?

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

      yeah I think it all depends on what you’re doing, but the minWidth / maxWidth can help with that

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

    Hi I've got a question. Whenever I start my application I instantly go to the ListView. Isn't the purpose of this tutorial giving the user the possibility to signup and login?

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

      Yes! I created the tutorial to include an automatic login … ideally the user wouldn’t have to log in every time they use the app, so I wanted to show that as well (around 15:50) … to reset this, you could change the code, or just delete the app from your simulator or device and run again!

  • @EvertonAmorimSilva
    @EvertonAmorimSilva 6 місяців тому +1

    Does this work by using storyboard instead?

    • @logankoshenka
      @logankoshenka  6 місяців тому

      yep! firebase code should be the same!

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

    Yeeeah
    Just what we need

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

    At 20:53 *let dog = Dog(......)*
    I'm having some troubles with my code. The error message pops up "Expected expression after operator," with the "l" underlined for 'let.'
    My code is a little different. Just replace "dog" with "workout."
    let workout = Workout(........)
    Does anyone have any idea how to fix the error?

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

      sorry for the late response, did you solve your issue?

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

    Hi, when making the text field you need to be precise where you press in order to open it, any idea on how to expand the surface to press ?

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

      yes - play with .frame() modifier … try it in a few different orders, but you should be able to increase the tappable area by increasing the frame

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

      @@logankoshenka i tried that aswell sadly and it just expend the area but not the tappable area

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

    In many tutorials with sign-in/sign-up pages, I see the sign-up page doesn't have a "confirm password" field. I thought it was a standard, best practice to have both a Password and Confirm Password field. No?

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

      Yeah I agree … for the sake of this tutorial I was mainly showing the firebase aspect, but you could easily add another field and do an if / else check to see if the two passwords match before registering the user!

  • @SOK-gn6hw
    @SOK-gn6hw 2 роки тому +1

    Hey! Thanks for video. I did every thing same with you but when i try to open list view xcode says there is not enough internet connection, until then view will be offline. But the login and register part is work fine.

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

      hmm, did you get this worked out? sorry for the late response!

    • @SOK-gn6hw
      @SOK-gn6hw 2 роки тому

      @@logankoshenka i follow the steps on firebase and add init code to main page.

    • @SOK-gn6hw
      @SOK-gn6hw 2 роки тому

      cant understand what is the problem exactly then i restart everything just like what firebase says

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

    Is the firestore meant to be tied with the sign up feature? So, a new account is created, the firestore stores that new users information, and the login feature is what the authentication feature is for?

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

      correct! if you're not saving any user data on firestore, it is not needed for authentication ... I like to tie the two together so when a user signs up, we're also saving their info :)

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

    About the Dog file.. gives me an error.. saying: Type 'Dogs' does not conform to protocol 'Identifiable'. Why this is happening?

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

      It usually says that when you don’t have an ID variable

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

    Instead of Rectangle for underline, can just use Divider()

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

      You’re 100% right haha for some reason I was worried about the spacing … sometimes I’ll use Rectangle instead for more customization.

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

    Hey! On 27:07 I get an error on line 19 "Cannot find 'dataManager' in scope". Could you please help me fix this, thanks!

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

      my apologies, I didn't see your comment - I hope you were able to solve your issue!

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

    Hey, I made the Sign Up and Log In separate, but whenever I Sign Up and go to Log in, I need to navigationLink to the Sign In Screen View, which already puts me in the main menu, since the if sees that userLoggedIn = true, any ideas for that? I tried to change the bool with a State change on the Sign Up view, but that doesn't work

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

      you could do something like : NavigationLink(destination: loggedIn ? oneView : anotherView) … does that make sense?

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

      @@logankoshenka Hey, thank you for the quick answer, I just implemented Auth.auth().signOut function provided by Firebase and it all worked out! :D But I'm going to look into your idea as well.

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

      great!!!

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

    Nice video! Does the auth code allow for the app to be closed and login to be saved? Meaning login details are persistent and the user won't have to login each time they open the app?

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

      yes! that part is covered in the video!

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

      @@logankoshenka Cool! Do you have any tips on how to log out?

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

      yes! firebase has a logOut or signOut function as well … I thought I covered it here but if I didn’t, a search for “firebase swift signOut” will be the way to go 👍🏼

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

      @@logankoshenka appreciate the help and the quick replies mate! Keep up the good work. Gained a sub 💪🏾

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

      of course, thank you!

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

    Question: if I have a Firebase application that gets a list of users and gets a list of X and a list of Y.... should I have three different data managers? or should the one data manager set up the different getDocuments and/or listeners for each collection?

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

      That's probably a matter of personal preference ... I guess I would decide based on how related X is to Y, like if they're some sort of subcategory of a similar thing, maybe the same ... but the majority of the time, being explicit and using separate data managers is best ... separation of logic makes it easier to think ... that being said it's up to you :)

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

    Does realm have a built-in authentication like Firebase. Also since i learnt mongodb, is Realm better than firebase?

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

      I’m not sure if they do or not … I wouldn’t say Realm is better, but I guess it depends on your needs. I used Firebase more so I’m more comfortable w that, but it kinda comes down to needs & personal preference

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

    22:15 is it necessary to add `id: \.id` since you declared `struct Dog: Identifiable`? It shouldn't be needed.

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

      Yes - you’re right about this one. It’s not needed. Thanks for catching that!

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

    I have one question related to Firebase. Will this data be available to all the users who are logged in to the Firebase? Or is this date associated to any user?

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

      you can organize your security rules & data in a way that only allows users to access their data if you’d like! look up “firebase cloud firestore security rules” and you’ll see what you can do :)

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

    19:18 is that necessary? Isn't part of the feature set / benefit of Firebase that it keeps the data in your app and in firestore in sync? If you remove all each time, then won't you download *all* the data each time instead of just incremental changes?

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

      totally necessary … if you don’t remove all, you’d get duplicates when you fetch! gotta clear previous use :)

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

    Could you please explain what to write where it says "//go somewhere" since i am struggling to make it go to a new page if login is successfull

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

      of course! Notice how it's an if / else statement ... so according to the state variable, we show either "content" or something else ... perhaps my comment in the code should have said "// show something else" ... basically, you could show another view by creating a var: body similar to how we set up "content" OR the better way would probably be to create another view in another file ... say we create a swiftui view called "HomeView" ... we add what we want to add, then we can replace "// go somewhere" with "HomeView()" so that it updates the view as soon as the user logs in ... make sense?

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

      @@logankoshenka got it working! Really appreciate the response, you got a new sub

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

      great to hear :D

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

    is it possible to get the final code?

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

      Hi Raquel, the source code can be found here: logankoshenka.gumroad.com/l/swiftuifirebase

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

    Why this is possible with super expensive database like this but not possible with mysql?

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

      what do you mean?

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

      @@logankoshenka I can't find any beginner friendly tutorial how to do it with MYSQL what is free.

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

      ahhh man I’m sorry to hear that!

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

    Is this secure enough for a real app?

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

      yes! the main thing to check is the security rules on firebase … when testing, the database is a bit vulnerable, but you can set it up so that you only allow read / write permissions to authenticated users … but yes, lots of apps out there are using firebase!

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

      @@logankoshenka thanks for the quick response what would you recommend for self hosting a database

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

    3Q so much!

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

    Hi Logan - at @9:39 when you don't add the initialization code, is there anything else we have to add (other than the FirebaseApp.configure()). I thought I might have missed something because I have a 'App Delegate does not conform to UIApplicationDelegate protocol' error message in the output. Apologies if I missed it in the video.

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

      sorry for the late response - did you figure it out?

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

      Did you name your project just Firebase. I did and I think that causes the error as you need to refer to it and the compiler then isn't sure, do you mean the app or the framework. Renaming the whole project and app struct resolved this error.

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

      I’m having the same issue :/

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

      I have the same error too and nothing comes on my firebase authentication user page.

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

    How would you get the data to automatically reload without having to close out of the app?

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

      what do you mean?

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

      @@logankoshenka you mentioned near the end of the video that you close out of the app and then dog data you wrote is now there. My question is more so, how would you go about avoiding to close out of the app and have it the dog data persist from adding it to Firestore to being pulled again since you added a new doc on the main screen. As the init() calls the fetchDogs on launch

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

      ahhh gotcha - definitely check out the async / await video I posted (my most recent)! You can use that format to call fetchDogs ... another approach is to use the pull to refresh ... in swiftui it is very straightforward! for that method, check this tutorial out: www.swiftbysundell.com/articles/making-swiftui-views-refreshable/

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

    I get a fatal error for DataManager

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

    How could I add a UUID() to create a unique id code for each dog? I tried adding it into the (dog swift file) dog struct variable id, although wasnt able to change it from String to Int... Any suggestions?

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

      UUID is like its own unique type … you can use UUID() or UUID().uuidString and you should def be able to use it for the dog’s id variable 💪

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

      @@logankoshenka thanks for the quick response! I’ll just have to tinker with the code a bit to get it working. Another quick question, I tried changing the content view variable userIsLoggedIn Boolean to true so that it toggles to false (just to test to see if I can get the login screen) and no matter what I do I can’t get the login/signup view to show…

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

      I even deleted the user on the fire base authentication page and can’t figure out how to get the create user page to work correctly

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

      try deleting the app on the device or simulator to reset it!

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

    I was just about to start dancing because I had not had any difficulties until the last moment...... I'm 13.36 mins into the video. The Build is Successful; however, I am not able to enter email address or password. Instead I get this message: Thread 1: "The default FirebaseApp instance must be configured before the default Authinstance can be initialized. One way to ensure this is to call `FirebaseApp.configure()` in the App Delegate's `application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI)." I am new so don't understand what to do with that. Any kind soul willing to help a newbie? I might have missed it. Thank you in advance.

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

      haha yes it's the part at roughly 10:20! it's just saying that firebase wasn't setup in your app yet! and that FirebaseApp.configure() takes care of that for you!

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

    20:33 if you had added `Codable` to your `struct Dog` earlier, you wouldn't need to decode each property one-by-one.

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

      true - I wanted to show it this way for the sake of the tutorial

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

    Bro you sound exactly like sean O'maley lol

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

      😂😂😂😂 first time I heard that

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

    how would they signout?

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

      I def should have included that! Here is the code snippet ... would just have to connect this to a sign out button:
      do {
      try Auth.auth().signOut()
      } catch let signOutError as NSError {
      print("Error signing out: %@", signOutError)
      }

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

      Awesome! Worked like a charm!

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

      😁 great!

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

      @@logankoshenka could you by chance give a more detailed explanation of how to do this because I cant seem to get it to work (im very new to programming)

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

    Great tutorial covering so much! It would be great to see a part 2 doing more with the DB side of the Firebase DB. I've jsut started exploring this so hoping to work out how to store and fetch images and delete etc. I've already made it a little more interesting for anyone else following along by adding the following code on to the List modifiers to add the pull to refresh feature! Next work out how to delete:
    .refreshable {
    await dataManager.fetchGuitars()
    }

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

      A log out function would also be great to go full circle. I've deleted the account in the Firebase db but the programme still logs into the ListView even when changing the initial App view to be the ContentView. I think this is because there isn't a way to check that the user still exists in the db? Not sure.

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

      Thanks! Will do!

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

    source code pls

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

      You can download the project here: logankoshenka.gumroad.com/l/swiftuifirebase

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

    This design is cap like try to set it up on other devices it will completely fail. People here don't know anything about swiftui