1. Create a remote repository on GitHub and select a License file.

2. Create your own project and fine-tune the directory structure

3. Create.podSpec

This file describes information about the project. Create pod Spec Create PFExtension using terminal commands in the project directory

Pod::Spec.new do |s|

  s.name         = "PFExtension"
  s.version      = "0.0.1"
  s.summary      = "some classes extension"
  s.homepage     = "https://github.com/pengfei2015/PFExtension"
  s.license      = { :type= >"MIT" }
  s.author             = { "xxxxxx"= >"[email protected]" }
  s.platform     = :ios
  s.platform     = :ios, "9.0"
  s.source       = { :git => "https://github.com/pengfei2015/PFExtension.git", :tag => "#{s.version}" }
  s.source_files  = "Soureces/*.swift"

end
Copy the code

4. Verify the format of the. Podspec file

pod lib lint

5. Resolve validation errors

1, The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a.swift-versionFile to set the version for your Pod. For example to use Swift 2.3, run:
'echo "4.0" >. Swift-version' // Swift version numberCopy the code
2, WARN | (iOS) license: Unable to find a license file

If you forget to select a license file when creating a remote repository, you can create a file on the home page. After entering the license file, the template will be displayed on the right

6. Associate with GitHub

    git remote add origin https://github.com/pengfei2015/PFExtension.git
    git push -u origin master
Copy the code

Create version number (tag)

Git tag 0.0.1 // git tag-a 0.0.1 -m "Note"
    git push --tags
Copy the code

Sign up for Cocoapods

pod trunk register GitHub_email 'user_name' --verbose

Wait until the terminal is displayed successfully and log in to verify the mailbox

9. Submit specs

pod trunk push PFExtension.podspec

10. Delete the search_index.json file from the local cache

rm ~/Library/Caches/CocoaPods/search_index.json