Jordi Saumell
05/23/2023, 6:04 PMkotlin super calls to objective-c protocols are not allowed
. Has anyone encountered this/knows how to solve it? I'll add more details in the threadinternal class Tracker(
private val onNewLocation: (Location) -> Unit,
) : NSObject(), CLLocationManagerDelegateProtocol {
override fun locationManager(manager: CLLocationManager, didUpdateLocations: List<*>) {
delegate.locationManager(manager, didUpdateLocations)
(didUpdateLocations.last() as? CLLocation)?.let { location ->
location.coordinate().useContents {
onNewLocation(Location(latitude, longitude))
}
}
}
}
internal class Tracker(
private val onNewLocation: (Location) -> Unit,
private val delegate: LocationManagerDelegate = LocationManagerDelegate(),
) : CLLocationManagerDelegateProtocol by delegate {
override fun locationManager(manager: CLLocationManager, didUpdateLocations: List<*>) {
delegate.locationManager(manager, didUpdateLocations)
(didUpdateLocations.last() as? CLLocation)?.let { location ->
location.coordinate().useContents {
onNewLocation(Location(latitude, longitude))
}
}
}
}
class LocationManagerDelegate(): NSObject(), CLLocationManagerDelegateProtocol
Delegated member 'fun locationManager(manager: CLLocationManager, didEnterRegion: CLRegion): Unit' hides supertype override: public open expect fun locationManager(manager: CLLocationManager, didEnterRegion: CLRegion): Unit defined in platform.CoreLocation.CLLocationManagerDelegateProtocol. Please specify proper override explicitly
for each of the methods that are being delegated.