Michael Krussel
02/19/2024, 4:35 PMextraOpts += listOf("-compiler-option", "-fmodules")
After I fixed that the types from the interop are off.
I have
@objc public static let mapPitchAlignment: Any = CirclePitchAlignment.map
And the interop reports the return type as Any?
@objc public func snapshot() -> UIImage? {
return try? mapView.snapshot()
}
Is now reporting the return type as objcnames.classes.UIImage?
instead of platform.UIKit.UIImage
Michael Krussel
02/28/2024, 9:03 PMobjecnames.classes.UIColor
instead of platform.UIKit.UIImage
.
My .def
file looks like
language = Objective-C
modules = MapboxCoreMaps MapboxWrapper PangeaCache PangeaRenderer UIKit
compilerOpts = -fmodules
MapboxWrapper (Swift library) uses classes from MapboxCoreMaps (Objective-C library) and UIKit
PangeaRenderer (Objective-C library) uses classes from MapboxCoreMaps, PangeaCache (Objective-C library), and UIKit
I found that after adding UIKit to the modules, I got the correct mappings for all the classes except for one class in MapboxCoreMaps that was being returned by a class in MapboxWrapper, and I was just able to cast it to the right type.
Is there a better way to interop with a lot of libraries that all depend on each other.
I'm going to go and downgrade Kotlin, but that is not a long term solution.Michael Krussel
02/29/2024, 3:44 PM