-->

iOS Private Frameworks

2019-06-02 07:20发布

问题:

I'm trying to use Private Frameworks in my project, The problem is when I add the .framework file to the project, there is no header file

Any solution for that?

Thanks!

回答1:

What BJ Homer said is correct: private frameworks are for Apple's use only, so there's no reason why they would ship the headers.

That said, if you want to walk on the wild side, and you don't want to submit your app to the app store, you can try using class-dump to create headers based on the library file in the framework. This won't generate the real headers that Apple uses - you just get the method signatures. You don't get any constants or C functions, and you certainly don't get any informative comments. Any private frameworks you do use will probably change in the next release of iOS, breaking your app.



回答2:

You can browse and search the private (and public) headers https://github.com/nst/iOS-Runtime-Headers generated dynamically by iOS Runtime Browser https://github.com/nst/RuntimeBrowser/.



回答3:

That's precisely why they're labeled "Private"; they don't want other people using them, and thus have not included the headers.