Exposure Methods in the iOS Static Library

I want to show only the selected methods inside my Static library for external classes. Is there any way to do this?

+4
source share
2 answers

This is not possible as Objective-C works. The best thing you can do is not to publish these methods by declaring them in an internal header (either in a continuation of a class or in a category) that you do not provide to the library user. Using tools such as classdump or runtime APIs, these methods can still be found and called.

+1
source

Here's an approach to do this:

  • , , . . MyClass + PrivateMethods

  • , MyClass + PrivateMethods.h , , . (, - Public, Private Project).

  • # MyClass + PrivateMethods.h, , (.m) .

  • Profit.
+1

Source: https://habr.com/ru/post/1529782/


All Articles