Simple observable struct with RxSwift?
问题 I'm trying to come up with a simple observable object in Swift and thought to use RxSwift. I couldn't find a simple example to do something like this: protocol PropertyObservable { typealias PropertyType var propertyChanged: Event<(PropertyType, Any)> { get } } class Car: PropertyObservable { typealias PropertyType = CarProperty let propertyChanged = Event<(CarProperty, Any)>() dynamic var miles: Int = 0 { didSet { propertyChanged.raise(.Miles, oldValue as Any) } } dynamic var name: String =