iOS User Defaults Tutorial

  Рет қаралды 2,374

Code Pro

Code Pro

Күн бұрын

Пікірлер: 9
@CodePro
@CodePro 6 жыл бұрын
User Defaults is great for storing client side settings in your app. Although we could achieve the same thing using Core Data or maybe even writing to a text file, with only a few lines of code we can save values and read values quite easily from User Defaults.
@glebserediuk4666
@glebserediuk4666 5 жыл бұрын
Thanks for the easy lesson but very valuable info hello from Ukraine ))
@CuriosMindDIY
@CuriosMindDIY 6 жыл бұрын
Awesome and very clear tutorial, now It makes total sense! I was just wondering, do sqlite and realm work with similar technique?
@CodePro
@CodePro 6 жыл бұрын
Yeah they work in a similar fashion as far as where they are stored on the simulator / device. Typically if you use a SQLLite backed CoreData implementation it will save a .sqlite file on the file systems just like UserDefaults save a .plist file with the data.
@CuriosMindDIY
@CuriosMindDIY 6 жыл бұрын
Code Pro Thank you! You’re the man!
@CodePro
@CodePro 6 жыл бұрын
Haha, no problem, glad it helped and good question :)
@stevengao8345
@stevengao8345 6 жыл бұрын
thanks for this tutorial, very clear to understand, but i do have a question that every time i use userdefault, do we need to use Userdefault.standard.synchronize( ) to end it ? not really sure why i use it at the first place, just i remember some article i read long time ago, since then i have kept using it every time i do user default, will cause a problem if i don't use it ? thanks
@CodePro
@CodePro 6 жыл бұрын
This is a good question. The documentation is a little bit fuzzy from Apple. They actually say the method is unnecessary and should not be used. However, However I’m guessing this is a legacy API and Apple has never updated or deprecated this. I’ve also used the method right after setting something in user defaults and had no problem. I don’t think it matters much but if you are concerned there is no harm in using it.
@УчительЛитературы-х5щ
@УчительЛитературы-х5щ 6 жыл бұрын
Does with ViewController work? Help me pls ((
19  User Defaults
11:01
Ali Farhat
Рет қаралды 781
Refactoring The Massive View Controller
30:55
Code Pro
Рет қаралды 2,9 М.
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 155 МЛН
Каха и лужа  #непосредственнокаха
00:15
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 206 МЛН
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 70 МЛН
Swift Optionals Explained
25:51
Code Pro
Рет қаралды 2,5 М.
Modern CSS for sites: View transitions, scroll effects, and more!
51:38
Chrome for Developers
Рет қаралды 11 М.
iOS Unit Test Mocking Tutorial
24:50
Code Pro
Рет қаралды 27 М.
iOS Local Notification Tutorial
26:30
Code Pro
Рет қаралды 7 М.
How to Make an App in 8 Days (2024) - Full Walkthrough
3:00:49
CodeWithChris
Рет қаралды 870 М.
I Can't BELIEVE They Let Me in Here!
23:37
Linus Tech Tips
Рет қаралды 310 М.
How to save @Published into UserDefaults in SwiftUI or UIKit
0:16
Victor Kushnerov
Рет қаралды 1 М.
How To Handle Permissions Like A Senior Dev
36:39
Web Dev Simplified
Рет қаралды 84 М.
The A.I. Revolution: How to get RICH
9:06
Frederik Denuit
Рет қаралды 9
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 155 МЛН