wickwirew / Runtime

A Swift Runtime library for viewing type info, and the dynamic getting and setting of properties.
MIT License
1.08k stars 94 forks source link

how to get class/struct by name? #78

Open uiiang opened 3 years ago

uiiang commented 3 years ago

how to get class/struct by name string?

struct Person{}

let info = typeInfo(of:"Person")

wickwirew commented 3 years ago

Unfortunately this is not possible. If I recall correctly it may be possible to get the type/type info from the mangled name, but not just the name itself.

edudnyk commented 2 years ago

@wickwirew Does the library support getting a type, and then type info by mangled name?

wickwirew commented 2 years ago

@edudnyk unfortunately it does not