-
namespace conflict. The static library uses a third-party library, and the project uses the same third-party library, and there are errors when compiling, duplicate symbol because there are two identical third-party libraries. The solution is to add a custom prefix to the third-party library used, including the class name, the delegate protocol, the constant name, and, in particular, the method name of the category to be modified.
-
When you encapsulate a static library, you should try to avoid introducing heavyweight third-party libraries and encapsulating them yourself.
-
A static library must have its own unique prefix, and all class names, constants, and so on, must be prefixed with the same prefix.
-
Real machine + simulator support. Xcode only generates a static library with the current environment (real machine or simulator), which is not convenient for debugging other project development. The solution is to generate a generic library from a script, Build_universal_library.sh,via so.
-
Document. The convenience of the static library is the user directly to use the method you provide, do not pay attention to the specific implementation, inconvenient to see the implementation, problems can not be detected, it is necessary to the SDK version, update history, use, FAQs and other written documents, easy to use, also appears to be the SDK more formal specifications.
-
A resource file such as a picture is packaged in bundle form. A simple way to make bundles: Create a new folder, rename YourSDK.bundle it, then Show Package Contents open it, and add a picture. You need to specify the bundle when using the picture: [UIImage imageNamed:@"YourSDK.bundle/img.png"] . You can also create bundles using Target, such as the IOS Library with Resources.
-
Modifying the SDK product path is primarily convenient for packaging, see build_universal_library.sh.
-
SDK header files Plus version numbers and simple usage notes, developers don't like lengthy document:D.
-
If the SDK is useful to the Category, note that the project Settings Other Linker Flags -ObjC are added, QA1490.
-
The SDK can be added to the Sdkdemo project in the form of sub-projects, so that it can be tested while developing. Sdkdemo modified User Header Search Paths to ${SYMROOT}/${CONFIGURATION}-universal/YourSDK , the path and the build_universal_library.sh remain consistent.