Why do I want to use a static library?

I understand that for purposes other than iOS, using shared libraries can lead to reduced memory usage, and also that some companies distribute the library and headers (like Superpin ), and the static library allows them not to distribute the source of their product. But outside of them, what are the reasons you want to use a static library? I use git for all of my projects, and I usually add external libraries (open source) as a submodule. This means that they occupy disk space locally, but they do not clutter up the repo. In addition, since iOS does not support shared libraries, the benefits of creating libraries to facilitate code reuse are diminished.

Basically, is there any reason beyond selling closed source libraries that it makes sense to create / use static libraries for iOS?

+3
source share
3 answers

organization, reuse and easy integration into other programs.

If you have a library that is used by multiple applications or targets on multiple platforms, you will need to maintain a build for each application. with the library, you allow the library developer to configure the assembly correctly, then you just refer to the result (if it is developed internally, then you also want to add it as a dependency).

He is like DRY, but for projects.

, . , (, ..) - , .

, , , , .

+1

. , , exec , , , ... , , - . .

0

, iOS , , .

There is no reason why you cannot create your own static library for use in multiple projects. Besides, for this purpose and those you mentioned, I no longer think.

0
source

All Articles