Create CocoaPods production process

The use of CocoaPods to manage the third party library is very convenient, after learning to use CocoaPods, began to try to create a version of their own dependence on the library, of course, sooner or later to go to this step

Create warehouse

Next to achieve a home page advertising function, the project name is CLRollingCycleView

Local warehouse

Use Xcode to create a CLRollingCycleView project, project and add Classes (core functionality)

Remote warehouse

Create a GitHub on the same CLRollingCycleView, it is best to keep the same name, it should be noted that in the creation of the warehouse need to add license type, where I use the license type is MIT

Associate local repository to remote warehouse

Enter the directory where the local warehouse is located

CD ~/workspace/CLRollingCycleView

Associated remote warehouse

Git remote origin [email protected]:chrislian/CLRollingCycleView fetch git merge origin/master add git master

##** add Pods dependent libraries required to file * *
dependent libraries required file format to {project}.podspec format, each Pods dependent libraries must have this description file

Add {project}.podspec file

Pod spec CLRollingCycleView //Specification created at create CLRollingCycleView.podspec

This will generate a CLRollingCycleView.podspec file, open the file to add content, and delete unnecessary:

Pod:: do |s| = "CLRollingCycleView" s.version = "0.0.1" s.summary = "circular scrolling picture" s.description = < < -DESC circular scrolling pictures, automatic playback, manual play DESC s.homepage = " chrislian/CLRollingCycleView s.license" = "MIT" "chrislian" => = {[email protected]}; s.platform: IOS,'6.0'= s.source = {git: => "", "s.version} #{: tag => s.source_files}" = "CLRollingCycleView/Classes/*.{h, m}" s.framework "UIKit" true = s.requires_arc = end

S.source_files points to the core code of the loop scroll placed on the project’s CLRollingCycleView/Classes*.{h, m}

Submit to GitHub

At this point, the required documents are basically ready, then submit to GitHub

Pod verification

Pod lib lint

If there is a mistake, it will clearly point out where the error, according to the prompts to modify information

Submit code to GitHub

Git add. Git -m version 0.0.1 git origin push commit master


Git tag git push 0.0.1 --tags

Not a problem, you can see the latest in GitHub submission
{project}.podspec ##** upload to CocoaPods official warehouse * *
to a real CLRollingCycleView can be used to bring the generated CLRollingCycleView.podspec files submitted to the official Cocoapods Specs warehouse, and can be used to search

In accordance with the rules of GIT, to add files to others in a warehouse, fork, and push to add modifications to the author, waiting for the audit, and the road has been blocked.

CocoaPods provides us with a more convenient and secure method trunk

Register Trunk

If the first use, then you need to register, you need more than cocoapods version 0.33 to support

The next few steps need to be provided with a ladder, otherwise it may not reach

Pod trunk *youremail*'*yourname*'--description='iMac' register --verbose

The above command is required to register, replace your mailbox, user name, and description, –verbose can enter a detailed debug

After the completion of the mailbox to verify that you can continue to operate

After successful registration, you can use

Pod trunk me

View registration information, as well as published Pods

Submit {project}.podspec

Under the {project}.podspec file path

Pod trunk push CLRollingCycleView.podspec

This order does the following three things:

  • Verify the local podspec file, you can also use pod lib lint authentication
  • Upload podspec files to trunk service
  • Convert {project}.podspec file to {poject}.podspec.json file

If there is no error, then the basic right


Terminal execution pod search CLRollingCycleView can be found, if you do not find pod setup try again

-> CLRollingCycleView (0.0.1) pod'CLRollingCycleView'circular scrolling pictures,'~> 0.0.1' - Homepage: - Source: - Versions: 0.0.1 [master repo] (END)

Cooperative work

When you need other people to work together to maintain your code, you need to provide permissions,

Pod trunk add-owner CLRollingCycleView [email protected]

On CocoaPods Publish Your Pods with Trunk
): a reference link