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

Fix #51 and remove load method referenced from objc files #52

Merged
merged 5 commits into from
Mar 26, 2019

Conversation

kealdishx
Copy link
Contributor

In objc file, I use __attribute__((constructor)) to replace +load method. The calling sequence is load -> constructor -> main at runtime.

In swift file, The solution is that get all classes that conformed to SelfAware protocol via runtime and call functions defined in SelfAware protocol before applicationDidFinishLaunching method called.And I use static let instance to do the same thing as dispatch_once.

@Coeur
Copy link

Coeur commented Mar 1, 2019

Woah, you're good, I didn't know about __attribute__((constructor)) before.

@pmusolino
Copy link
Owner

Thanks for this PR @iiiCeBlink! I will review it asap.

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

Successfully merging this pull request may close these issues.

3 participants