Static LibraryThe so-called static library, or. A file, is a collection of target files compiled from the source code. It is the binary that corresponds to the implementation of your source code. In conjunction with the public. h file, we can obtain the methods or members that are exposed in. A. When the app was finally compiled. A will be linked to the final executable file, and each time it is loaded with the app's executable binaries, you can't control how and when the load is loaded, so it's called a static library. prior to iOS 8, iOS only supported the use of Third-party code in a static library. Dynamic Frameworkthe corresponding to the static is of course dynamic. The framework of the IOS system we use every day is the end of the. Framework, which is the dynamic framework. The Framework is actually a bundle, or a special folder. The system's framework exists inside the system and is not packaged into the app. When the app starts, it checks to see if the required dynamic framework has been loaded. Common system frameworks such as Uikit are generally in memory and do not need to be loaded again, which guarantees app startup speed. Compared to the static library, the framework is self-contained, you do not need to care about the header file location, etc., easy to use. Universal FrameworkIOS 8 also has a number of third-party libraries that provide. framework files, but they are essentially static libraries, but are packaged in a number of ways that are more useful than traditional. A. Like the original Dropbox and Facebook, this method is used to provide the SDK. However, because it has been out of the times, so I do not say here. Friends who are interested and need to see here and here. Library && Frameworkcompared to static libraries and dynamic frameworks, the latter has many advantages. First, a static library cannot contain resource files such as xib files, pictures, and other developers must copy them into the main bundle of the app to be able to use, maintain and update very difficult, and the framework can include resource files in their own bundle. Second, the static library must be packaged into binary files, which is not a big problem in previous IOS development. But with the advent of IOS extensions (such as Notification Center extensions or Action extensions), you may now need to include the same. A in the app ontology and in the extended binaries, which is unnecessarily repetitive. Finally, the static library can only be loaded with the application binary, and the dynamic frame does not need to be loaded again after it is loaded into memory, and the two start speeds up. In addition, load timing can be controlled when used. There are many advantages to dynamic frameworks, but unfortunately Apple did not allow the Third-party framework to use dynamic methods, but only the system framework can be loaded dynamically. Cocoa Touch FrameworkApple, starting with IOS 8, allows developers to conditionally create and use dynamic frameworks called the Cocoa touch Framework. Although also a dynamic framework, unlike the system framework, the COCOA touch framework used in the app is packaged and submitted to the app bundle, running in a sandbox, not a system. That is, different apps use the same framework, but there are multiple frames that are signed, packaged, and loaded separately. the Cocoa Touch Framework was launched primarily to address two issues: first, the expanded development from IOS 8 that was mentioned earlier. The second reason is that swift, before Swift opens its source, does not support the compilation of a static library. Although there is the possibility of compiling as a static library after open source, it is still not practical because Binary Interface is not determined. These problems will be resolved in Swift 3, but it will be at least until the second half of this year. now, Swift Runtime is not in the system, but is packaged in various apps. So if you want to use the Swift static framework, because the ABI is incompatible, we will have to include a runtime in the static package again, which may cause the same app package to include multiple versions of the runtime, which is not advisable for the time being. Package and Dependency managementUsing the framework, some package management and dependency management tools can simplify the process. One of the most widely used now should be [Cocoapods], using: http://blog.csdn.net/feng2qing/article/details/49983423excerpt from: Wang Wei speech https://onevcat.com/, China's first swift developer conference #blog
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.