David Holas
02/12/2024, 3:34 PMkotlin.time.Duration
is inconsistently passed into swift code.
class UsedInSwiftCode {
val durations = listOf(10.minutes) // In swift this is just [Any]
val duration = 10.minutes // In swift this is Int64 of... half-nanoseconds?
}
But other classes (as far as I can tell) are represented in their fullish form in swift in both cases above.
Why is that? Is there some way to make it consistent? Or should I just write my own Duration
and use that instead? Also I am confused about the representation in swift, it seems to be a number of half nanoseconds in that duration which is strange to me, why would it be like that?Dovydas
04/21/2025, 11:16 AMDavid Holas
04/21/2025, 11:18 AMDuration
class that works normally in swiftDovydas
04/21/2025, 11:18 AMDavid Holas
04/21/2025, 5:39 PMDuration
, its pretty simple really. Just fun toNanoseconds() = kotlinDuration.toNanoseconds()
type of stuff for every method. I just wanted the Duration
class to be treated in Swift in a same way as any other class, no half-nanosecond nonsense.