Skip to content

Commit

Permalink
Updated README for swift ui (#10)
Browse files Browse the repository at this point in the history
* video demo

* video demo

* video demo

* Update README.MD

* added gif demo

* added gif demo

* added gif demo

* added gif demo

* version bump

* updated README.MD

* updated version and added kotlin weekly tag to README.MD

* updated version and added kotlin weekly tag to README.MD

* fixed sample

* updated readme for swift ui usage

* fixed sample dependencies
  • Loading branch information
Kashif-E authored Oct 7, 2024
1 parent ac2b247 commit 5352157
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,39 @@ implementation("io.github.kashif-mehmood-km:voyant-voyagerx:0.0.5")

```Kotlin
implementation("io.github.kashif-mehmood-km:voyant-navigation-compose:0.0.5")
```

## Swift UI

- For Swift UI there is one small extra step

```Swift


struct NavigationControllerWrapper: UIViewControllerRepresentable {

func makeUIViewController(context: Context) -> UINavigationController {
// MainKt.MainViewController() is the entry point of the app wrapped inside a uinavigation controller
//so you can get the navigation controller from the view controller
let navigationController = UINavigationController(rootViewController: MainKt.MainViewController())
navigationController.interactivePopGestureRecognizer?.isEnabled = true
return navigationController
}

func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {

}
}
// content view being used inside AppDelegate to set the root view controller
struct ContentView: View {
var body: some View {
NavigationControllerWrapper()
.edgesIgnoringSafeArea(.all)
}
}



```


Expand Down
4 changes: 2 additions & 2 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ kotlin {
implementation(compose.material)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
// api(projects.voyagerX)
// implementation(projects.navigationComposeX)
api(projects.voyagerX)
api(projects.navigationComposeX)
implementation(libs.kotlinx.serialization.json)
}

Expand Down

0 comments on commit 5352157

Please sign in to comment.