Joseph Roffey
03/18/2021, 12:32 PMKotlin supports interoperability with Objective-C dependencies and Swift dependencies if their APIs are exported to Objective-C with theI am hitting an issue trying to depend on a pod (SPPermissions) which I think might be because it is a “Pure Swift” dependency, although I’m not sure I can be certain about that, as this is the first pod I’ve tried to depend on… As it says “Pure Swift dependencies are not yet supported” I was wondering if there is a link to monitor the planned implementation of supporting Pure Swift dependencies, and was wondering if there is a suggested workaround e.g. forking the relevant project and adding in theattribute. Pure Swift dependencies are not yet supported.@objc
@objc
exports required or else releasing a delegate project that simply imports the Swift dependency and exposes an Objective C api?
I’m by no means an expert on KMM so am worried I might be trying to do something that just can’t work with the current methodology, but I’d be keen to hear any advice anyone might have.mkrussel
03/18/2021, 1:32 PMCGPoint
. An Objective-C framework did not have that problem. Also ran into the same issues with the framework I wanted not using @objc
because the majority of the code does not support it.
I went with the route of creating my own delegate project to expose what I needed to Objective-C, but it did involve having to wrap a lot of their structs
into classes that could be exposed to Objective-C. Did have the benefit of only needing to expose the features I was using.
Depending on the library, a fork might be easier.Joseph Roffey
03/18/2021, 1:34 PMmkrussel
03/18/2021, 1:57 PMJoseph Roffey
03/18/2021, 1:57 PMmkrussel
03/18/2021, 1:59 PMstruct
and creating properties that forward everything to the struct
.Any
then casted back to enum inside wrappers.Sam
03/18/2021, 3:24 PMmkrussel
03/18/2021, 3:27 PMJoseph Roffey
03/18/2021, 3:33 PMSam
03/18/2021, 4:21 PMJoseph Roffey
03/18/2021, 4:22 PM