Introduction to the

What is a library? A library is a collection of program code, a way of sharing program code. Libraries can be divided into two types depending on the source code

Open source library open source code, you can see the specific implementation such as SDWebImage, AFNetworking

Closed source library is not open source code, is compiled after the binary file, can not see the specific implementation is mainly divided into: static library, dynamic library

Static and dynamic libraries

Static libraries and dynamic libraries exist in the form of static libraries:.a and.framework Dynamic libraries:.dylib and.framework

Let’s start with the production process of library A

1. Project introduction of creating a static library

What is a library? A library is a collection of program code, a way of sharing program code. Libraries can be divided into two types depending on the source code

Open source library open source code, you can see the specific implementation such as SDWebImage, AFNetworking

Closed source library is not open source code, is compiled after the binary file, can not see the specific implementation is mainly divided into: static library, dynamic library

Static and dynamic libraries

Static libraries and dynamic libraries exist in the form of static libraries:.a and.framework Dynamic libraries:.dylib and.framework

Let’s start with the production process of library A

1. Create a static library project

Add source code to the static library:

3. Write header files and code methods that need to be exposed:

Public header files need to be dragged into the Public category:

4. Compile on the simulator and real machine respectively, and wait until the. A file changes from red to white show in Finder

5. Merge. A library

A static library file libstaticlibchomp.a will be found in the project file path after the merge

The successfully merged.a library is the final static library that can be used by dragging the header files exposed by the.A library into the project