Skip to content
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

CocoaPods 'use_frameworks!' option breaks dependency injection #33

Open
s-k opened this issue Apr 11, 2016 · 3 comments
Open

CocoaPods 'use_frameworks!' option breaks dependency injection #33

s-k opened this issue Apr 11, 2016 · 3 comments

Comments

@s-k
Copy link

s-k commented Apr 11, 2016

I have created a simple iOS project with CocoaPods and dependency injection using BloodMagic. It works perfectly. However, if I add the 'use_frameworks!' option in the Podfile, the app breaks. An error is thrown, which complains that the getter method of the dynamic property does not exist.

@tkach
Copy link

tkach commented Jun 15, 2016

+1.
Seems that BMClassCollector can't collect classes when built in a Dynamic Framework.

const char *imageName = class_getImageName(object_getClass(self));
const char **classNames = objc_copyClassNamesForImage(imageName, &classesCount);

This code searches classes in the Dynamic Lib that contains BMClassCollector. In the case of using dynamic frameworks (use_frameworks!), we have own separate framework for BloodMagic, and it
just doesn't see any classes outside.

@s-k
Copy link
Author

s-k commented Jun 18, 2016

Actually, I have created a pull request some time ago to fix this issue:

#34

@DanSkeel
Copy link
Contributor

@s-k your solution works only with classes that are direct subclasses of NSObject.

Here is more general solution that was used before optimisation: #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants