Recently I've created small iOS class and I would like to use it with CocoaPods. By now I have added it to the GitHub and I have followed this tutorial which explains the process of creating CocoaPod but I have stuck with this one: "Adding the Podspec to the CocoaPods Specs Repo".
Can someone explain following steps, like how to fork the repository and issue a pull request. I know there are a lot of similar answers on Google but I would be very appreciative if someone can share it's experience with creating CocoaPods.
Also is there an option for checking what will be final result when I add pod to my project before I make it public?
To create a Podspec, navigate to your project file in the Terminal. Run the following command to create the file: touch FantasticView. podspec . Now open the file using an editor.
You now need to use Trunk to upload your spec. Firstly, ensure you have registered a session with Trunk:
pod trunk register [email] [name] --description=[your session description]
pod spec create
SuperAwesomeProject.podspec
file and save. Podspec Syntax Guide
pod spec lint
and fix any errors it reports.pod trunk push SuperAwesomeProject.podspec
Much simpler than the old method below!
Note: The information posted below is now outdated.
DO NOT DO THIS. I'm just leaving it here for posterity..
git clone [email protected]:github-username/Specs.git
cd Specs && mkdir -p project-name/version-number
e.g. mkdir -p SuperAwesomeProject/0.0.1
cd SuperAwesomeProject/0.0.1
pod spec create
SuperAwesomeProject.podspec
file and save. Podspec Syntax Guide
pod spec lint
and fix any errors it reports.git commit -am "Added SuperAwesomeProject"
git push origin master
If you already have a podspec file, just copy it into the SuperAwesomeProject/0.0.1
folder and skip step 7.
Perhaps, my answer is too late... Anyway, please find below steps that I've performed:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With