Step 1: For the convenience of searching, I first cd the desktop path /Users/xxx/Desktop
Step 2: Create a private library name pod lib creat KMWaterMark
After creation, there will be a folder. Open the folder and put your own tool class into the classes folder, and then open your own project in Example. After executing pod install on the command line, Example will run. There is no problem and proceed to the next step.
Step 3: cd the generated folder path /Users/xxxx/Desktop/KMWaterMark, then execute
pod lib lint --allow-warnings, passed validation appears, indicating that there is no problem
Step 4: Project release
git remote add origin https://github.com/kongmingyang/WaterMark.git
git add .
git commit -a -m "The first commit version is 0.0.1"
git push -u origin main
//Push podspec to cocoapods warehouse
pod trunk register
pod trunk push KMWaterMark.podspec
reference article
iOS - Create your own pod - Short Book
Creation and management of componentized CocoaPods private library - Nuggets