Daniel
12/18/2024, 12:26 AM@Serializable
data class GeoPoint(
var latitude: Double = 0.0,
var longitude: Double = 0.0
)
I am trying to instantiate a simple object in my iOS (Swift) code:
@State var myGeopoint = GeoPoint()
However this returns the error:
'init()' is unavailable
For a list of GeoPoints the error does not appear.
Why this is different?
Any easier workaround? This should be related to Kotlin more than with Swift I believe.
I just want a simple contructor with the properties empty/null.ephemient
12/18/2024, 1:14 AMephemient
12/18/2024, 1:15 AM@Serializable
data class GeoPoint(
var latitude: Double,
var longitude: Double,
) {
constructor() : this(latitude = 0.0, longitude = 0.0)
}