I am trying to determine if multiplatform will allow me to achieve my goal of 1 common library usable by Android & IOS (and eventually js hopefully) but cannot find much in the way of documentation on expect/actual syntax and usage rules
I have built the IOS Android tutorial and am now trying to retrofit my MVP Interface structure into it to see if it will work the way I envision
I have a series of Interfaces in more or less standard MVP pattern for Android with View interfaces and Presenter interfaces, etc. The presenter interfaces will be defined and the classes implementing them in kotlin in the shared code common src directory, the View interfaces will be invoked by the presenter to call back to either the Android Activity or the IOS ViewController classes to display the results on screen, as per the intent of multiplatform as far as I can tell.
But my interfaces are collections of abstract functions, I am not allowed to put the expect keyword on a member function, just a top level function or at the class or interface level.
On the platform specific side I can put the actual keyword on a member function but it does not have an expect to match with.
I need to put expect on my Interface definition (which encompasses all the methods for it i would assume), and then the platform specific actual is really the Android or IOS view Class that implements that common View interface (not an interface itself) … So when a common presenter method is executing , a call to the view.method() triggers the actual method on the view class for the platform it is running on
I am also not too clear on what if any impact there might be since my interface definition structure (which is nested) would be translated into an ios framework when swift (although i gather the framework is objc) does not allow for nested protocols.
any similar experiences or guidance would be appreciated, thanks