Compose Multiplatform Application with IOS native Navigation for IOS App in common code and Voyager for other platforms
- use voyant to get started without any boilerplater Voyant for using ios navigation with CMP
- Looking to build with KMP and CMP? Let's connect LinkedIn
- Featured in Kotlin Weekly
This project is an experiment to explore how iOS navigation can be implemented using Compose Multiplatform. The goal is to leverage Kotlin Multiplatform capabilities to create a seamless navigation experience on both Android and iOS platforms.
-
Navigation Setup:
- The
Navigatorclass is used to manage navigation between different screens. - The
BottomSheetNavigatoris used to handle bottom sheet navigation.
- The
-
View Controller Wrapping:
- The
extendedComposeViewControllerfunction creates aUIViewControllerthat hosts a Compose UI. - The
UIViewControllerWrapperclass wraps anotherUIViewControllerand adds gesture recognizer functionality to handle swipe gestures.
- The
-
Gesture Handling:
- The
UIViewControllerWrapperimplements theUIGestureRecognizerDelegateProtocolto handle swipe gestures. - Swipe gestures are added to the view controller to enable navigation through swiping.
- The
-
Interactive Pop Gesture:
- The
interactivePopGestureRecognizeris enabled for the entire screen to allow swipe-back navigation. - The delegate for the
interactivePopGestureRecognizeris set to theUIViewControllerWrapperto manage the gesture.
- The
