edit userdefault

This commit is contained in:
Jungpyo Hong 2021-05-21 15:50:22 -05:00 committed by GitHub
parent 9b66231a21
commit 6e35b5153a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,9 +428,15 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau
}
```
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/DocumentPath.png" />
simply move into that path and you can find the documentDirectory of your Application
> if Library is not shown up, just do **Shift + Command + .** to show hidden files in your folder
### Usage
f
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultPlistPath.png" />
As you can see in the below, intArray will stored inside the device through UserDefaults(), so that if device is shut down, changed value wil be stored in device.
```swift
@ -451,6 +457,11 @@ class ViewController: UIViewController {
}
}
```
You can your plist file like this!
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultPlist.png" />
**You are GOOD TO GO** 👏👏👏
## Core Data