- Notifications
You must be signed in to change notification settings - Fork 3
UIKit Integration
Thiago Santos edited this page Aug 18, 2024 · 1 revision
Important
This module is a case of studies that shows how you can extend Kotlin Routing to your context.
This module provides a way to work with UIKit UIViewControllers and route to them.
sourceSets { iosMain.dependencies { implementation("dev.programadorthi.routing:uikit:$version") } }
Installing the UIKit plugin needs to provide a UINavigationController.
import dev.programadorthi.routing.darwin.UIKitPlugin // ... val router = routing { install(UIKitPlugin) { navigationController = YourUINavigationControllerInstance } }
val router = routing { controller(path = "...") { YourUIControllerInstance } }
router.call(uri = "...", routeMethod = RouteMethod.Push)
router.call(uri = "...", routeMethod = RouteMethod.Replace)
router.call(uri = "...", routeMethod = RouteMethod.ReplaceAll)
router.popController() // or animated router.popController(animated = true)
Type-safe and other improvements are on the road.