adev_one
05/25/2018, 9:12 PMinterface Article {
val id: Int
val category: Category
}
interface Category {
val id: Int
}
Swift:
@objc
class RealmArticle: Object, KNArticle {
@objc dynamic var id: Int32 = 0
@objc dynamic var category: RealmCategory = RealmCategory() // type does not conform to protocol KNArticle
}
@objc
class RealmCategory: Object, KNCategory {
@objc dynamic var id: Int32 = 0
}
svyatoslav.scherbina
05/26/2018, 11:28 AM@objc dynamic var category: RealmCategory = RealmCategory() // type does not conform to protocol KNArticleThis limitation is imposed by Swift, not Kotlin. How do you suggest to change generated
KNArticle
protocol to support covariant overriding in Swift?