mirror of
https://github.com/jphong1111/awesome-ios-developer.git
synced 2025-07-04 15:27:58 +07:00
Update README.md
This commit is contained in:
11
README.md
11
README.md
@ -48,6 +48,7 @@ Feel free to fork this repository and pull requests!!
|
|||||||
- [JSONSerialization](#JSONSerialization)
|
- [JSONSerialization](#JSONSerialization)
|
||||||
- [UserDefaults](#UserDefaults)
|
- [UserDefaults](#UserDefaults)
|
||||||
- [How to find documentDirectory](#How-to-find-documentDirectory)
|
- [How to find documentDirectory](#How-to-find-documentDirectory)
|
||||||
|
- [Store Object](#Store-Object)
|
||||||
- [Core Data](#Core-Data)
|
- [Core Data](#Core-Data)
|
||||||
- [Set Up Core Data](#Set-Up-Core-Data)
|
- [Set Up Core Data](#Set-Up-Core-Data)
|
||||||
- [Core Data Usage](#Core-Data-Usage)
|
- [Core Data Usage](#Core-Data-Usage)
|
||||||
@ -584,7 +585,7 @@ The UserDefaults class provides a programmatic interface for interacting with th
|
|||||||
- Flags, more on this later
|
- Flags, more on this later
|
||||||
- If store data is small
|
- If store data is small
|
||||||
|
|
||||||
### How to find documentDirectory
|
## How to find documentDirectory
|
||||||
|
|
||||||
Put this line of code inside of your project
|
Put this line of code inside of your project
|
||||||
```swift
|
```swift
|
||||||
@ -601,7 +602,7 @@ simply move into that path and you can find the documentDirectory of your Applic
|
|||||||
|
|
||||||
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultPlistPath.png" />
|
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultPlistPath.png" />
|
||||||
|
|
||||||
### Usage
|
## Usage
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
@ -642,6 +643,12 @@ let defaults = UserDefaults.standard
|
|||||||
|
|
||||||
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultGet.png" width = "60%" height = "60%"/>
|
<img src = "https://github.com/jphong1111/Useful_Swift/blob/main/Images/UserDefaultGet.png" width = "60%" height = "60%"/>
|
||||||
|
|
||||||
|
## Store Object
|
||||||
|
|
||||||
|
There are two ways of store object in UserDefault
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
**You are GOOD TO GO** 👏👏👏
|
**You are GOOD TO GO** 👏👏👏
|
||||||
|
|
||||||
## Core Data
|
## Core Data
|
||||||
|
Reference in New Issue
Block a user