Zewo / Reflection

DEPRECATED
MIT License
599 stars 46 forks source link

Classes as well as Structs #12

Closed J7mbo closed 6 years ago

J7mbo commented 6 years ago

Any chance this can work with classes as well as structs? If not, is it because the functionality isn't possible, or just needs a PR?

bradhilton commented 6 years ago

Unfortunately I haven't found a way to safely initialize classes. If someone has a solution I'd welcome a PR.

J7mbo commented 6 years ago

I was messing around with it, but it seemed every class needed to extend NSObject, with loads of @objc markers everywhere.

However, once you do that, you can reflect on everything using objective c methods, even method signatures, arguments, their types etc. Unfortunately, you're writing more objective-c than swift then ;)

Thought I'd share it anyway. Maybe in the future we'll get better reflection support in swift. Closing until that point, thanks!