-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typhoon Injection By Type with Swift #248
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
I've just noticed that it's impossible to use by-type property injections with Swift. Basically no class can be resolved at runtime. The problem seems to be that in Swift you need to prepend
AppName.
to class name forNSClassFromString
. On the other hand,property_getAttributes
returns type descriptor without this prefix.One of the possible solutions I found would be to get the app prefix from the target injection class (using
NSStringFromClass
) and then trying to prepend this prefix to type property's type descriptor (if the current method fails to resolve the class).Would you accept a PR with this? Or do you see a better solution for this problem?
The text was updated successfully, but these errors were encountered: