Skip to content

Commit

Permalink
Merge pull request #35 from qiaoyuang/main
Browse files Browse the repository at this point in the history
Fix README
  • Loading branch information
qiaoyuang authored Jun 8, 2024
2 parents 349806e + df62294 commit 35d7252
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

中文版本请参看[这里](README_CN.md)

MMKV-Kotlin is a porting of [MMKV](https://github.com/Tencent/MMKV) to Kotlin Multiplatform. Currently Android/iOS/macOS are supported.
MMKV-Kotlin is a porting of [MMKV](https://github.com/Tencent/MMKV) to Kotlin Multiplatform. Currently, Android/iOS/macOS are supported.

## Tutorial

Expand All @@ -16,7 +16,7 @@ dependencies {
}
```

Current version based on `Kotlin 1.9.23` and `MMKV 1.3.5`.
Current version is based on `Kotlin 1.9.23` and `MMKV 1.3.5`.

Pure Android platform (kts):

Expand All @@ -37,7 +37,7 @@ dependencies {
implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosarm64:1.2.12")
}
```
Note, if your project is a Kotlin/Native executable program project of macOS or it supply a framework to a iOS application project directly, then you need to manually add dependency on MMKV, and may need add `linkerOpts` on MMKV and MMKVCore:
Note, if your project is a Kotlin/Native executable program project of macOS, or it supplies a framework to an iOS application project directly, then you need to manually add the dependency of MMKV, and may need to add `linkerOpts` for MMKV and MMKVCore:

```kotlin
kotlin {
Expand Down Expand Up @@ -72,7 +72,7 @@ kotlin {

### Initialization and Configure Root Path

You can initialize MMKV when app or process initialization. [MMKV-Android](https://github.com/Tencent/MMKV/tree/master/Android/MMKV) initialization API depends on [Context](https://developer.android.com/reference/android/content/Context). So, Android's initialization API is different from iOS.
You can initialize MMKV when your app or the process initialization. [MMKV-Android](https://github.com/Tencent/MMKV/tree/master/Android/MMKV) initialization API depends on [Context](https://developer.android.com/reference/android/content/Context). So, Android's initialization API is different with iOS.

Android:

Expand Down Expand Up @@ -102,7 +102,7 @@ You also could call [MMKV-Android](https://github.com/Tencent/MMKV/tree/master/A

### CRUD Operations

- MMKV has a **global instance**, you can use it directly:
- MMKV has a **global instance**, you can use it directly:

```kotlin
import com.ctrip.flight.mmkv.defaultMMKV
Expand Down Expand Up @@ -139,7 +139,7 @@ fun demo() {
}
```

- **Deleting & Judging(Whether the key is exist):**
- **Deleting & Judging (Whether the key is existed):**

```kotlin
kv.removeValueForKey("Boolean")
Expand All @@ -151,7 +151,7 @@ println("allKeys: ${kv.allKeys()}")
val hasBoolean = kv.containsKey("Boolean")
```

- If different modules/logics need **isolated storage**, you can also create your own MMKV instance separately:
- If a different modules/logics need **isolated storage**, you can also create your own MMKV instance separately:

```kotlin
import com.ctrip.flight.mmkv.mmkvWithID
Expand All @@ -160,7 +160,7 @@ val kvWithMyId = mmkvWithID("MyID")
kvWithMyId.set("Boolean", true)
```

- If **multi-process accessing** is needed, you can set `MMKVMode.MULTI_PROCESS` on MMKV initialization:
- If **multi-process accessing** is needed, you can set `MMKVMode.MULTI_PROCESS` when MMKV initialization:

```kotlin
import com.ctrip.flight.mmkv.mmkvWithID
Expand Down

0 comments on commit 35d7252

Please sign in to comment.