Swift Tutorial: Save & Get Data with User Defaults
HTML-код
- Опубликовано: 24 июл 2024
- Let's explore how to save and get data in an iOS app using UserDefaults. User Defaults are a great and simple way - built right into iOS to accomplish this task.
💻 Source Code: / iosacademy
🎥 Subscribe for more: ruclips.net/user/iOSAcademy?su...
😎 Like my teaching style? Check out some of my most popular courses!: courses.iosacademy.io
iOS Academy offers the #1 course for iOS Development for Beginners. Learn to create iPhone and iPad apps from scratch. Everyone these days has an app idea; learn the important skill of making those apps, make yourself more marketable, change industries to get a different job, and enjoy the ride!
This video is brought to you by Skillshare - an only community of teachers sharing awesome skills. Use the following link to get 2 months of FREE premium: www.skillshare.com/r/user/afraz
Thank you so much for the content! It's very helpful!
Youre welcome!
Great video! Question: If I'm passing a string from a textview to be displayed on a separate view's textview through the prepare method (using segue identifiers and all that) would I implement this code on the destination view controller's swift file? Also, my data passes and displays correctly on the destination's textview.
i love your channel please continue these great videos!
Thank you so much! I plan on it :) Stay tuned
Great video and great teacher. Im learning alot from your vids. Thanks a lot. A hug from Brazil 🇧🇷
best video on youtube.Short and on point
This was a good tutorial, I liked how you explained things!
Glad it was helpful!
What would you recommend using if I wanted to save around 200 movie quotes in a database? Core data or something else?
I have a question about the limitations of user defaults: if I were needing to store like several months worth of text data and have it display that data on a graph, it is appropriate to use this method? The context is on a workout app where you can input your weight and reps and I want it to save that data and show it back to the user on a different tab
Do you recommend using User Defaults to store the account details of a User after logging into our app, for example?
Great videos, keep making them and we will keep on coming back....
Thanks, will do!
Thanks!
Youre welcome
big like from me too. I can listen to you way easier than to my prof. thx
I have 3 questions (sry) :
Number 1: if i wanted a UITextField to have the value of the String how would that work because i tried it and it didn’t work
Number 2: How could u save a image or a video?
Number 3: Could u make a video on an exporting function like a pdf etc...
Thx love ur vids!!
its insane to me how fast you fix your errors. When i get an error, as a beginner i gotta look it up. Keep up the great content, its helped me tremendously through learning swift!
Thanks! Its all in the practice
kindly make a video on bundle ID. great content 🔥😁
Thanks will do
Good job.
Thanks
@@iOSAcademy OMG YOU REPLIED
THATS CRAZY
CAN I HAVE YOUR AUTOGRAPH
YOUR MY FAVOURITE CODER
That was complicated bro for beginners... i like your other tutorials but i think i have to watch another tutorial for userdeafults
Thanks for the feedback
I coded following App with your video (ruclips.net/video/E6Cw5WLDe-U/видео.html) now I want to save both entries from the AddViewController with UserDefaults.
But I have no idea how, please help me
Hey there, you need to first start by getting the values out of the fields with a field.text. Then pick a userdefault key, as shown in the video, to save it. Something like this: UserDefaults().standard.set(myValue, for: "myKey")
@@iOSAcademy In the AddViewController we are having two textfields a title and a body, is the UserDefault in the AddViewController or in the ViewController, if it is in the ViewController where do I set/get them
@@applentonio1376 UserDefaults are shared app wide. They are not different across 1 or more view controllers. If you create UserDefaults.standard as seen in the following docs, it will be the same object across the entire project: developer.apple.com/documentation/foundation/userdefaults
@@iOSAcademy I've testing it for the past few hours and I can't find the right way to do it. Is it possible to show you my Code via TeamViewer or something like that?
Very useful content, thanks! But the zoom effect is kind of distracting, maybe just highlight.
Youre welcome
these zooms are annoying and makes me nauseous
Stop Zooooooming pleaseeeeee