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
Millions of years ago, an asteroid hit, causing s...
How does seo make money? How to make money with S...
Note: The cover image is a copyrighted image. Rep...
Excerpted from: Inside and Outside the Classroom ...
According to the New York Times, security researc...
In the Chinese and even global mobile phone market...
What I will talk about today is mainly related to...
I really admire these rumor mongers! They are uny...
Naming plants is a science. I am Rong Ge from the...
Whether at home, in the elevator, on the subway, ...
Recently, I am developing the Gallery module of m...
Why is YouTube the fastest growing company in Sil...
This article mainly talks about how million-dolla...
According to the China Passenger Car Association,...
[[142136]] Microsoft has released the official ve...