I remember when I first started iOS development, there was no project dependency management tool. When you need to introduce a third-party library, it is quite troublesome. You either need to copy the library directly or add a dependency project. This situation did not change until CocoaPods came out. Project dependency management is not the first of its kind in CocoaPods. It has already appeared in many other project developments and has even become a standard feature of development. Despite this, CocoaPods still makes a huge contribution to iOS/Mac development. I would like to express my gratitude to those who have contributed to CocoaPods. CocoaPods is not very powerful, but it is useful enough most of the time. Just the most basic sample configuration can meet most of the needs of your project, but knowing more about some of its features will make you more comfortable. Specify Source CocoaPods supports private Spec repositories. We can build our own sources or use unofficial sources. As long as they comply with the regulations, they can be specified.
Suppress warnings The inhibit_warnings parameter can effectively suppress warnings generated by third-party code libraries introduced by CocoaPods. All can be specified.
Can also be targeted.
Use the branch pointed to by git's HEAD
Using the master branch
Specifying a branch
Specify tags
Specify commit
Using sub-libraries It can be like this
You can also specify multiple sub-libraries like this
Using native code You can specify local code through :path, but you need to make sure the directory contains a podspec file.
Specify the target's dependent library
Exclude tags
Specifying xcodeproj By default, the first xcodeproj in the same directory as the Podfile file will be used, but you can also specify
Specify the target of the connection If you do not explicitly specify a target to connect to, Pods will connect to the first target of the project by default. If necessary, you can use link_with to specify one or more targets to connect to.
Specify the environment The following will only add the PonyDebugger library to the project under the Debug environment.
Specify the target configuration file
Use Dynamic Frameworks instead of Static Libraries This feature can be enabled by using the flag use_frameworks! If you need to use Swift libraries, you must add this flag. Speed up pod install/update When using CocoaPods to add third-party libraries, whether executing pod install or pod update, it often gets stuck at Analyzing dependencies. This is caused by updating the local pod spec file. The --no-repo-update flag can be used to not update the local pod spec index. Of course, the first install should not add this flag, but it can be used appropriately when modifying the Podfile later to speed up the pod.
Output detailed log
Cocoapods plugin for XCode cocoapods-xcode-plugin is an XCode plug-in that allows you to easily operate Cocoapods. It is a very useful plug-in. END My level is not good enough, if there are any mistakes, please correct me. |
<<: Planning introduction: numerical design starts from these three aspects
>>: The future of Android - PC-based
The author of this article will interpret group f...
According to Binjiang, the construction of the fi...
The article is a bit long, but you will definitel...
Fan-shot stills of the drama "Ning An Ru Men...
How to do maternal and infant marketing on Douyin...
Whether it is the BAT giants or emerging startups...
The three most critical steps in live streaming s...
Today’s sharing content is about the details of d...
Since its debut at the beginning of this year, th...
October 14th of every year is World Standards Day...
Preface to Qianmeng.com’s 36 Strategies for Makin...
Traffic operation cannot be carried out blindly w...
This is the 4712th article of Da Yi Xiao Hu Cold ...
The May Day holiday is approaching, which means i...
Recently, with the adjustment of national epidemi...