Gibt es eine einfache Möglichkeit, in Swift ReactiveCocoa 4 MutableProperty aus MutableProperty zu erstellen?Erstellen von MutableProperty <T> von MutableProperty <U> in Swift ReactiveCocoa 4
Ich habe einen Fall, und ich möchte eine Möglichkeit, Klasse B mit KlasseA zu erstellen, in dem ich StatusB mit StatusA einrichten muss, aber wie soll ich das tun?
class ClassA {
var statusA = MutableProperty<T>
}
class ClassB {
var statusB = MutableProperty<U>
func getStatusB(from StatusA: T) -> U {
// .. assume this is implemented.
}
init(statusB: U) {
//...
}
convenience init(from classA: ClassA) {
self.statusB = // here how to setup this value from classA's statusA with getStatusB(from:)?
}
}
Ich fand ähnlich bei https://github.com/ReactiveCocoa/ReactiveCocoa/issues/2183 – JerryZhou
nach Karte (..) MutableProperty werden AnyProperty , aber nicht MutableProperty –
JerryZhou