How to Create a CocoadPods Library?

Building your own CocoaPods library in Swift involves several steps. Here’s a guide to help you get started:

  1. Set Up Your Development Environment.
  2. Create Your Swift Project.
  3. Write Your Library Code.
  4. Create a Podspec File.
  5. Push Your Code to GitHub.
  6. Validate Your Podspec.
  7. Publish Your Library.
  8. Using Your Library.

Make sure you have the necessary tools installed:

  • Xcode
  • CocoaPods

First, navigate to the desired directory where you want to create your custom Pod. Once you have selected the folder, open the terminal within that directory.
To create a new project for Pod creation, run the following command:

pod lib create [POD_NAME]

After that, proceed with configuring your Pod as necessary.
A.
 What platform do you want to use?? [ iOS / macOS ]
iOS
B. What language do you want to use?? [ Swift / ObjC ]
Swift
C. Would you like to include a demo application with your library? [ Yes / No ]
Yes
D. Which testing frameworks will you use? [ Quick / None ]
None
E. Would you like to do view based testing? [ Yes / No ]
No

Once the setup is complete, it redirect to the project within XCode. If the directory is not already open, open it manually.

Set the default pod template setting to the minimum version:

  • iOS deployment target: 12.0
  • Swift version: Swift5
  • Project Format: Xcode 12-compatible

In addition, reflect this updated configuration in both Xcode and the relevant files.

The .podspec file defines your library and its dependencies. Here’s a basic example:

Pod::Spec.new do |s|
  s.name         = 'YourLibraryName'
  s.version      = '0.1.0'
  s.summary      = 'A short description of YourLibraryName.'
  s.description  = <<-DESC
                   A longer description of YourLibraryName.
                   DESC
  s.homepage     = 'http://yourlibraryhomepage.com'
  s.license      = { :type => 'MIT', :file => 'LICENSE' }
  s.author       = { 'Your Name' => 'your.email@example.com' }
  s.source       = { :git => 'https://github.com/username/YourLibraryName.git', :tag => s.version.to_s }
  s.ios.deployment_target = '10.0'
  s.swift_version = '5.0'
  
  s.source_files = 'Sources/**/*.{swift,h,m}'
  s.public_header_files = 'Sources/**/*.h'
  
  s.dependency 'SomeOtherPod', '~> 1.0'
end

Creating a Codebase Directory

Delete the ReplaceMe.swift file and Create Classes folder in the directory:
Pods project > Development Pods group > [POD_NAME] group

Create a file with the same name as the Pod within the Classes folder and use it to write custom code for the Pod.
example: <POD_NAME>.swift
You can also create multiple folders and files in order to write personalize code.

Refer to the screenshot for clarification:

Push Your Code to GitHub

Now, We are at the stage where you can easily share your iOS development work with community by publishing personalize Pod to CocoaPods.

  1. Initialize a Git repository in your project folder if you haven’t already:
git init
git remote add origin https://github.com/username/YourLibraryName.git
git add .
git commit -m "Initial commit"
git push -u origin master

2. Create a tag for your version:

git tag '0.1.0'
git push --tags

Publish Your Library:

  1. Register your pod with the CocoaPods trunk (if you haven’t already):
    • pod trunk register joynalcu7@gmail.com 'Joynal Abedin' --description='Macbook Air'
    • pod trunk me
  2. Validate Pod using lint
    • pod lib lint <POD_NAME.podspec>
    • pod lib lint <POD_NAME.podspec> --allow-warnings
  3. Deploying a Library
    • pod trunk push [POD_NAME.podspec]

119 thoughts on “How to Create a CocoadPods Library?

  • 17/07/2024 at 4:40 AM
    Permalink

    [url=https://mounjaro-5mg.ru/mundzharo]мунжаро 5 мг купить[/url] – тирзепатид цена инструкция +по применению +для женщин, mounjaro купить +в россии цена

    Reply
  • 17/07/2024 at 5:05 AM
    Permalink

    [url=https://mounjaro-kupit.su]mounjaro tirzepatide купить[/url] – тирзепатид купить +в москве, тирзепатид отзывы худеющих

    Reply
  • 18/07/2024 at 6:09 AM
    Permalink

    hop over to this web-site [url=https://jaxxliberty.io/]jaxx liberty[/url]

    Reply
  • 18/07/2024 at 6:34 AM
    Permalink

    click this link here now [url=https://Trader-joe.homes/]trader joe[/url]

    Reply
  • 19/07/2024 at 10:21 AM
    Permalink

    Get More Information [url=https://martianwallet.at/]martianwallet login[/url]

    Reply
  • 19/07/2024 at 1:30 PM
    Permalink

    read what he said [url=https://phantom.lu/]phantom wallet download[/url]

    Reply
  • 20/07/2024 at 11:11 PM
    Permalink

    In balancing a shaft, technologies and equipment from Vibromera were employed, ensuring accuracy and reliability of the work. This solved the vibration issue and extended the mechanism’s lifespan. More information can be found on the company’s website https://vibromera.eu/example/2253/

    Reply
  • 21/07/2024 at 5:06 AM
    Permalink

    [url=https://sova-gg.com]Сова гг обменник[/url] – Сова обменник, Sova gg обменник

    Reply
  • 21/07/2024 at 3:05 PM
    Permalink

    [url=https://sova-gg.com/]Sova gg обменник[/url] – Сова гг обмен валют, Сова гг

    Reply
  • 23/07/2024 at 7:13 AM
    Permalink

    [url=https://tronlink.cash/]tron link[/url] – tronlink, tronlink pro

    Reply
  • 23/07/2024 at 9:38 AM
    Permalink

    Discover More Here [url=https://my-jaxxwallet.io/]download jaxx wallet[/url]

    Reply
  • 24/07/2024 at 5:08 AM
    Permalink

    [url=https://kraken102.at]ссылка на кракен тор kraken 7 one[/url] – kraken зеркало v5tor cfd, kraken ссылка v5tor cfd

    Reply
  • 24/07/2024 at 3:58 PM
    Permalink

    [url=https://kraken103.at]kraken ссылка зеркало официальный сайт krakentor site[/url] – kraken актуальные ссылки 2kmp org, kraken ссылка onion 2kmp

    Reply
  • 25/07/2024 at 3:37 AM
    Permalink

    [url=https://all3dp.com.ua/3d-plastik-filament-pla]пла[/url] – тпу пластик, пла плюс

    Reply
  • 25/07/2024 at 11:07 AM
    Permalink

    pop over to this website [url=https://hamsterkombat.zone]hamster kombat coin[/url]

    Reply
  • 25/07/2024 at 2:39 PM
    Permalink

    [url=https://mellanin.ru/]купальник со стрингами купить[/url] – парео купить, купальники zeki интернет магазин

    Reply
  • 26/07/2024 at 1:20 PM
    Permalink

    Greetings,

    Am glad to connect with you, My name is Pitroda Satyan G, am an investment consultant with Shrooq AlQamar Project Management Services Co LLC, I have been mandated by the company to source for investment opportunities and companies seeking for funding, business loans, for its project(s). Do you have any investment or project that is seeking for capital to fund it?

    Our Investments financing focus is on:

    Seed Capital, Early-Stage, Start-Up Ventures, , Brokerage, Private Finance, Renewable Energy Project, Commercial Real Estate, Blockchain, Technology, Telecommunication, Infrastructure, Agriculture, Animal Breeding, Hospitality, Healthcare, Oil/Gas/Refinery. Application reserved for business executives and companies with proven business records in search of funding for expansion or forcapital investments..

    Kindly contact me for further details.

    await your return e.mail soonest.

    Regards

    Dr. Pitroda Satyan G

    Shrooq AlQamar Regional Consultant
    Address: 72469 Jahra Road Shuwaikh Industrial
    Tel/WhatzApp: +968 7866 9578
    Email: agent@shrooqconsultant.com
    Our Offices:
    Middle East Facilitating Office: Ahmad Al Jaber St, Kuwait City, Kuwait
    Oman Branch Offices: CHXM+J3G, Sohar, Oman
    UAE Dubai: Financial Consortium

    Reply
  • 27/07/2024 at 2:00 AM
    Permalink

    look at this website [url=https://installs.info]buy windows desktop[/url]

    Reply
  • 27/07/2024 at 12:19 PM
    Permalink

    [url=https://xn—–8kcaaomxdpelhyeeqjefp6c.xn--p1ai/%D1%83%D1%81%D0%BB%D1%83%D0%B3%D0%B8/%D1%8D%D0%BA%D1%81%D0%BA%D1%83%D1%80%D1%81%D0%B8%D0%B8_%D0%B8%D0%B7_%D0%B0%D0%BD%D0%B0%D0%BF%D1%8B/%D0%B0%D0%B1%D1%80%D0%B0%D1%83_%D0%B4%D1%8E%D1%80%D1%81%D0%BE]Экскурсия Абрау-Дюрсо[/url] – Морская рыбалка в Анапе, Экскурсия Абрау-Дюрсо

    Reply
  • 28/07/2024 at 4:39 AM
    Permalink

    [url=https://midnight.im/store/chity-cs-1-6/]скачать приватный чит для кс 1.6[/url] – скачать читы для cs go, Чит кс 2

    Reply
  • 28/07/2024 at 2:21 PM
    Permalink

    [url=https://midnight.im/store/chity-cs-go/]приватные читы для кс го купить[/url] – приватный чит для apex legends, скинченжер Counter Strike 2

    Reply
  • 28/07/2024 at 5:29 PM
    Permalink

    [url=https://midnight.im/store/chity-cs-1-6/]читы counter strike[/url] – cheat Counter Strike 2, приватные читы на кс 1.6

    Reply
  • 29/07/2024 at 12:14 AM
    Permalink

    [url=https://olimp-shop.net/]купить аккаунт вк за 1 рубль[/url] – купить аккаунты фейсбук с отлежкой, где купить аккаунт инстаграм

    Reply
  • 29/07/2024 at 6:43 AM
    Permalink

    [url=https://gamer-torrent.ru/download/pc/shooter/the_day_before/10-1-0-1894]THE DAY BEFORE обзор игры[/url] – бесплатные игры 2023, строительные материалы волгодонск

    Reply
  • 29/07/2024 at 11:45 AM
    Permalink

    сайт [url=https://xn—-jtbjfcbdfr0afji4m.xn--p1ai/]электрик томск[/url]

    Reply
  • 29/07/2024 at 2:19 PM
    Permalink

    navigate here [url=https://crazy-pachinko.com]pachinko online casino[/url]

    Reply
  • 29/07/2024 at 7:14 PM
    Permalink

    [url=https://sova-gg.com/]Сова гг[/url] – Сова гг обмен валют, Sova gg

    Reply
  • 29/07/2024 at 10:05 PM
    Permalink

    [url=https://diplom.ua/]оформлення курсової роботи зразок[/url] – замовити дипломну роботу, дипломна робота з педагогіки

    Reply
  • 29/07/2024 at 10:05 PM
    Permalink

    [url=https://diplom.ua/]дипломна робота скільки сторінок[/url] – готові контрольні роботи для заочників, як писати есе

    Reply
  • 30/07/2024 at 7:28 AM
    Permalink

    [url=https://diplom.ua/ru/]курсовые работы на заказ[/url] – писать курсовые на заказ, курсовая работа заказать украина

    Reply
  • 30/07/2024 at 8:35 AM
    Permalink

    [url=https://skripters.biz/xf/]XenForo русификации[/url] – WordPress модификации, WordPress плагины

    Reply
  • 30/07/2024 at 11:29 PM
    Permalink

    [url=https://t.me/ozempic_kupit_prodaja/]лираглутид отзывы худеющих[/url] – мунжаро цена +в аптеках, дулаглутид инструкция +по применению отзывы

    Reply
  • 31/07/2024 at 6:23 AM
    Permalink

    [url=https://cs2cheats.io]freecs2 cheat[/url] – cs2 wallhack, cs2 free cheats

    Reply
  • 31/07/2024 at 3:12 PM
    Permalink

    [url=https://rutor2go.com]live rutor[/url] – теневой форум рутор, rutor главный форум

    Reply
  • 31/07/2024 at 3:13 PM
    Permalink

    [url=https://moscowneversleep.com/]вип эскорт москва[/url] – эскорт модели москва, эскорт сопровождение

    Reply
  • 31/07/2024 at 6:32 PM
    Permalink

    [url=https://onion.moriartimega.com]mega darknet зеркала[/url] – mega onion, мега даркнет маркет ссылка

    Reply
  • 01/08/2024 at 3:52 AM
    Permalink

    [url=https://volna.la/]волна darknet[/url] – volna даркнет, volna даркнет ссылка

    Reply
  • 01/08/2024 at 4:49 AM
    Permalink

    [url=https://black.sprut.ltd]блэкспрут тор[/url] – blacksprut net, блэкспрут лтд

    Reply
  • 01/08/2024 at 5:55 PM
    Permalink

    [url=https://mounjaro-kupit.su]mounjaro тирзепатид[/url] – mounjaro injection, ozempic mounjaro

    Reply
  • 02/08/2024 at 6:19 AM
    Permalink

    [url=https://kraken103.at]kraken даркнет зеркало 2kmp biz[/url] – кракен онион ссылка kraken one com, сайт кракен через тор kraken one com

    Reply
  • 02/08/2024 at 10:34 AM
    Permalink

    [url=https://kraken103.at/]рабочие ссылки kraken для компа[/url] – kraken зеркало тор krakenonion site, kraken ссылка onion krakentor site

    Reply
  • 06/08/2024 at 12:47 AM
    Permalink

    straight from the source [url=https://hamsterkombat.zone/]short squeeze hamster kombat[/url]

    Reply
  • 06/08/2024 at 2:24 AM
    Permalink

    try here [url=https://wasabi-wallet.io/]wasabi desktop wallet[/url]

    Reply
  • 06/08/2024 at 12:55 PM
    Permalink

    Continue Reading [url=https://coinomiwallet.io/]Coinomi Review[/url]

    Reply
  • 06/08/2024 at 2:32 PM
    Permalink

    [url=https://opt24.store/product-category/zhevatelnaya_rezinka/]жевательная резинка купить оптом[/url] – спортивные батончики оптом, спрайт оптом купить

    Reply
  • 07/08/2024 at 4:54 AM
    Permalink

    [url=https://tronlink.cash]tron link[/url] – tronlink, tronlink extension

    Reply
  • 07/08/2024 at 5:07 AM
    Permalink

    YOURURL.com [url=https://coinomiwallet.io]Coinomi Multi-Wallet[/url]

    Reply
  • 07/08/2024 at 12:23 PM
    Permalink

    [url=https://kraken102.at]kraken актуальные зеркала krakentor site[/url] – kraken ссылка dzen, kraken сайт krakendarknet top

    Reply
  • 07/08/2024 at 2:27 PM
    Permalink

    [url=https://kraken103.at]кракен ссылка kraken[/url] – kraken переходник 2024, kraken зеркало рабочее 2kraken click

    Reply
  • 07/08/2024 at 7:39 PM
    Permalink

    blog

    [url=”https://www.tumblr.com/sexythingil/753371253682946048″]https://www.tumblr.com/sexythingil/753371253682946048[/url]

    Reply
  • 10/08/2024 at 6:39 PM
    Permalink

    [url=https://kraken16at.co]kraken15[/url] – kraken 12at, kraken13

    Reply
  • 11/08/2024 at 4:20 AM
    Permalink

    [url=https://bs2tcite4.io]bs2web at[/url] – blacksprut зеркала, blacksprut официальный сайт

    Reply
  • 12/08/2024 at 4:13 AM
    Permalink

    [url=https://izhpnevmo.ru/pnevmooborudovanie/elektricheskie-privodyi/]электропривод[/url] – электропривод купить, электропривод купить

    Reply
  • 12/08/2024 at 4:24 AM
    Permalink

    [url=https://by.ndt.su/]капиллярный метод контроля[/url] – пенетрант для контроля, проявитель для капиллярного контроля

    Reply
  • 12/08/2024 at 4:08 PM
    Permalink

    [url=https://kz.ndt.su/]разъем высоковольтный для рентгеновского аппарата[/url] – набор для капиллярного контроля, флуоресцентная суспензия

    Reply
  • 13/08/2024 at 5:49 AM
    Permalink

    [url=https://xn—–8kcaaomxdpelhyeeqjefp6c.xn--p1ai/uslugi/]Джипинг в Анапе[/url] – Морская рыбалка в Анапе, Джипинг в Анапе

    Reply
  • 13/08/2024 at 10:39 AM
    Permalink

    [url=https://olimp-shop.net/category/vkcom-aktiv/]купить аккаунт вк авторег[/url] – купить женский аккаунт инстаграм, Купить аккаунт телеграм JSON SESSION

    Reply
  • 13/08/2024 at 11:13 AM
    Permalink

    [url=https://az.ndt.su/]дефектоскопист по магнитному и ультразвуковому контролю[/url] – ультрафиолетовый фонарь купить, пенетрант для сварных швов купить

    Reply
  • 14/08/2024 at 2:02 AM
    Permalink

    [url=http://www.museum-kruf.ru/]pinup bet[/url] – пинап вход, онлайн казино

    Reply
  • 14/08/2024 at 8:41 AM
    Permalink

    wikipedia reference [url=https://pin-up-bet1.com.br/]pin up brasil[/url]

    Reply
  • 15/08/2024 at 4:12 AM
    Permalink

    [url=https://bs2.st]blacksprut площадки[/url] – blacksprut ссылка tor, blacksprut blacksprut click

    Reply
  • 15/08/2024 at 4:21 PM
    Permalink

    [url=https://bs01.at]blacksprut поддержка[/url] – блекспрут com ссылка, bs2best

    Reply
  • 15/08/2024 at 10:01 PM
    Permalink

    this website [url=https://hamsterkombat.zone]short squeeze hamster kombat[/url]

    Reply
  • 15/08/2024 at 11:25 PM
    Permalink

    [url=https://xn—–8kcaaomxdpelhyeeqjefp6c.xn--p1ai/uslugi]Морская рыбалка в Анапе[/url] – Дайвинг в Анапе, Квадроциклы и баги в Анапе

    Reply
  • 16/08/2024 at 8:08 AM
    Permalink

    [url=http://www.museum-kruf.ru]pinup casino[/url] – пинап вход, pin up скачать

    Reply
  • 16/08/2024 at 8:14 AM
    Permalink

    see this website [url=https://pin-up-bet1.com.br]pin up entrar[/url]

    Reply
  • 17/08/2024 at 4:07 PM
    Permalink

    [url=https://kraken8tor.com/]как зайти на кракен через тор браузер[/url] – kraken тор, kraken tor ссылка

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *