I would like to have an object that is an ordered collection of multiple different kinds of Realm Objects, like so...
public class One: Object {
dynamic var name = ""
}
public class Two: Object {
dynamic var label = ""
}
public class Listing: Object {
let onesAndTwos = List<Object>()
}
Is there an elegant way to do this?
I know I can add an Enum-like wrapper object...
public class OneOrTwo: Object {
dynamic var one: One?
dynamic var two: Two?
}
public class Listing: Object {
let onesAndTwos = List<OneOrTwo>()
}
But I'd like to avoid that indirection, if possible.