Hello. Tell me, is it possible to somehow make pro...
# multiplatform
v
Hello. Tell me, is it possible to somehow make protocol Identifiable in the data class for swift?
h
Yes and no, there is no Swift interop so you can’t implement this interface in Kotlin, but you simple can define this interface in Kotlin and use the Kotlin interface in Swift with a Swift extension.
t
Copy code
extension RocketModel: Identifiable {
    public var id: Int {
        self.flightNumber
    }
}
maybe?
s
Pretty much yes. It should do the trick
x
Really like how in swift you can extend and add interfaces - wish we can do the same in Kotlin