-
Notifications
You must be signed in to change notification settings - Fork 13
How to create a new Cocoapod?
husnjak edited this page Sep 23, 2020
·
4 revisions
This Wiki is not for the PUBLIC, more for my self to "remember" how to update this projects cocoapods
I created this cocoapod by following these steps!
- Create a new project in Xcode, i used a single view application as it makes it easier to test.
- Build your Framework and write TESTS!
- Create the Github repo
- Now we create the Cocoapods library! I followed this tutorial, run this command:
$ pod lib create MyLibrary
this creates the basic library template which we will use!
5. Edit your Podspec metadata, I skip the README as i'm gonna write one on Github..
- Add Your project name
- Add the first verison number '0.1.0'
- Add a summary
- Add a description
- Change the hompage to Github
- Change the source to Github Clone source
- Add swift version
s.swift_version = 4.0
otherwise the linter will bitch about it. - Add source files location
MyLibrary/Classes/**/*
- Add your Optional dependencies, you can stack them!
s.dependency 'podName', ~> 1.0'
- Copy your Framework classes to MyLibrary/Classes folder
- Upload your work to Github & create the initial release version 0.1.0! IMPORTANT otherwise the lint will fail
- Done. Start lint..
$ pod spec lint
$ pod lib lint
- If everything passes create a new Xcode project and download you new project
# This usually works
pod 'MyLibrary', git: "https://github.com/husnjak/MyLibrary.git"
test it so you can find all of those internal classes that should be public...
10. Done, tell the world!