I don't know if I'm going about this the wrong way, but I'm really struggling to get this right or even get examples on the net.
So I want to create a KMM (Kotlin Multi Platform) library to use in my Android and iOS app.
In the Common section I want to either load a local image resource or create a new image and manipulate it, say write some text on it or draw a line on it.
Then I wa开发者_开发技巧nt to expose that image in the Android specific part to android and I want to expose that image in the iOS specific part to iOS.
So, some very basic pseudo code:
KMM
Common
fun loadLocalImageResource(): Image {...}
fun createNewImage(): Image {...}
Android
fun getLoadLocalImageResource(): Image {return loadLocalImageResource()}
fun getCreateNewImage(): Image {return createNewImage()}
iOS
fun getLoadLocalImageResource(): Image {return loadLocalImageResource()}
fun getCreateNewImage(): Image {return createNewImage()}
Thanks
精彩评论