Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create our own Cocoapods if app have already some other pods dependency like Almofire, SwiftJSON, etc

I have developed my own application and this app have already some pods dependency like Almofire, SwiftJSON, MBProgressHUD and many more. I want to create my own Cocoapods in which these dependency can be linked

like image 841
VipinYadav Avatar asked Feb 10 '20 02:02

VipinYadav


1 Answers

Please follow these steps to create your won Cococapods -

  • Create a public repository on your git account

Public Repo

  • Copy Repository Url. Open terminal and run following command.

    git clone <-Repository Url->.git

  • Now Copy all the xcode project file and folder inside the cloned repo. and run the below command

    git add *

    git commit -m "Initial Setup"

    git push origin master

  • Create a new release to go to your git repository or run following commands

    git tag 1.0.0

    git push --tags

  • Generate create Podspec file

Run the below command to generate the podspec file.

touch reponame.podscpec
  • Open the podspec file on any editor and paste these text as it is.

Format like below attached screenshot.

Format the string

Save the file and Now run the below command on terminal.

pod lib lint

If validation passed. then run the below commands

pod trunk register <[email protected]> 'user name'

You will get an email for verification. Just verify the email and now run the below command.

pod trunk push PodName.podspec

If all goes well, you will get this on terminal

Sample message

Congratulations. Now you can use this pod whenever you want.

like image 80
VipinYadav Avatar answered Nov 20 '22 19:11

VipinYadav