Hey guys, Im currently making a cmp app for android and ios. I need to display a pdf in the app and haven't found a library for it. I implemented it myself in android, but im having some problems with ios. It's my first app and I'm getting really confused. I use this git repo as a reference (https://github.com/swapnil-musale/KMP-PDF-Viewer/blob/master/shared/src/iosMain/kotlin/com/devx/pdfviewerkmp/di/ViewModelModules.kt), I could understand the android part but im really confused for the ios part. Could somebody with a better understanding explain it quickly to me? How do I call swift code from my kotlin code? Also, what is the use of iosApp and iosMain, where am I supposed to write my platform specific code?
c
Chris Athanas
04/24/2024, 9:27 PM
I would check out the samples from JetBrains for Compose, to get a better understanding for whats going on. As far as communicating between iOS and the KMP core application, there are many ways to approach it. I have tried a couple ways in my App “Fred’s Roadtrip Storyteller” for iOS and Android, you check check out how I handled things there: https://github.com/realityexpander/FredsRoadtripStoryteller