evermeer / EVReflection

Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
Other
965 stars 119 forks source link

Doesn't support Struct type? #326

Closed alexlee002 closed 2 years ago

alexlee002 commented 2 years ago

How can I use it with a swift Struct object?

evermeer commented 2 years ago

You can't The only way to dynamically set values is by using the setValue method on an NSObject. So the base class must be an NSObject and Structs can't have NSObject as its base class. It's even better to use EVObject as the base class because that has some helper functions.