mirror of
https://github.com/jphong1111/awesome-ios-developer.git
synced 2025-07-12 16:59:53 +07:00
edit userdefault
This commit is contained in:
11
README.md
11
README.md
@ -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
|
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
|
> 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.
|
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
|
```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
|
## Core Data
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user