Create an iOS dynamic library
Open Xcode and select the file-> New-> project ...
Coding work, here I simply wrote a MyTest class and wrote a log method.
Add. H, so that only one class can be referenced in the future.
Set the open header file: some classes in the framework may be private auxiliary tools and do not need to be seen by users. Here, just put the open class under Public, as shown in the figure, and drag MyTest.h from Project to Public, and Public is an exposed one. H file.
At this point, we can say that we have completed a simple framework. But, but, but we want to make a tall general dynamic library, not only for our own use, but also for others, which has improved a lot in an instant.
Making universal dynamic library
So how do we make a universal dynamic library? The simple method is to generate simulators and libraries running on real machines separately, and then merge them. This method will be very complicated every time the dynamic library is generated. Let's use a script to do it automatically. Xcode upper left corner Fiel-& gt;; New-> target ...
The content of the script is as follows:
After we run the program, we need to pay attention to one thing. If we want to support 64-bit, we need to set it in the compilation options, as follows:
At this point, our frame library file is completed and available in xcode window->; Select our project in the project and click the small arrow to enter the folder:
Under construction->; We can find our framework file in the product, and we can use it by distributing it.
Formed a framework.
test
Create a new project and add MyFirstFramework. The framework has just been completed. Notice MyFirstFramework here. The frame is added in the figure below, otherwise it will crash.
Let's quote and call methods that you can use.
**Xcode7 generates a general static library * *
On the basis of the above, a static library can be generated by modifying only one parameter.
Run it, copy it and you can use it. If you use a static library, you can delete the frame from the Embedded Binary.