Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/ktor-sql/xcode-other-linker-flags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions topics/development/multiplatform-ktor-sqldelight.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ Change or add lines in the version catalog in the `gradle/libs.versions.toml` fi
koin = "%koinVersion%"
ktor = "%ktorVersion%"
sqlDelight = "%sqlDelightVersion%"
lifecycleViewmodelCompose = "2.9.1"
material3 = "1.3.2"
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="[versions]"}
Expand All @@ -96,7 +95,6 @@ Change or add lines in the version catalog in the `gradle/libs.versions.toml` fi
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
native-driver = { module = "app.cash.sqldelight:native-driver", version.ref = "sqlDelight" }
runtime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDelight" }
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref="material3" }
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="[libraries]"}
Expand Down Expand Up @@ -588,7 +586,7 @@ kotlin {
androidMain.dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.koin.androidx.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodelCompose)
}
// ...
}
Expand Down Expand Up @@ -982,8 +980,12 @@ system-provided SQLite binary:

1. In IntelliJ IDEA, select the **File** | **Open Project in Xcode** option to open your project in Xcode.
2. In Xcode, double-click the project name to open its settings.
3. Switch to the **Build Settings** tab and search for the **Other Linker Flags** field.
4. Double-click the field value, click **+**, and add the `-lsqlite3` string.
3. Switch to the **Build Settings** tab, there switch to the **All** list and search for the **Other Linker Flags** field.
4. Expand the field, press the plus sign next to the **Debug** field,
and paste the `-lsqlite3` string into the **Any Architecture | Any SDK**.
5. Repeat the process for the **Other Linker Flags** | **Release** field.

![The result of correctly adding the linker flag to the Xcode project](xcode-other-linker-flags.png){width="434"}

### Prepare a Koin class for iOS dependency injection

Expand All @@ -1010,7 +1012,7 @@ module for iOS.
}
```

3. After the `KoinHelper` class, add the `initKoin` function, which you will use in Swift to initialize and start the iOS Koin module:
3. Below the `KoinHelper` class, add the `initKoin()` function, which you will use in Swift to initialize and start the iOS Koin module:

```kotlin
import com.jetbrains.spacetutorial.cache.IOSDatabaseDriverFactory
Expand Down