iOS組件化實踐過程

  1. 創(chuàng)建私有庫的索引文件repoA:
    pod repo add repoA repoA_url
  2. 創(chuàng)建私有庫podA:
    pod lib create podA
  3. 編輯podA代碼
  4. 遠程倉庫新建項目podA,注意不要勾選創(chuàng)建.md文件那些選項
  5. 打開podA.podspec文件,編輯好信息(可參考最后的example)
  6. podA推送到遠程:
    git remote add origin https://github.com/JW-chenjingwei/podA.git
    git branch -M main
    git push -u origin main
  7. 打上tag:
    git tag 0.1.0
    git push —tag
  8. 檢查podA是否通過:
    pod repo lint podA
  9. 把podA和私有庫索引repo關(guān)聯(lián)起來
    pod repo push repoA podA.podspec
  10. 檢查是否成功:
    pod search podA

Example:podA.podspec信息



Pod::Spec.new do |s|
  s.name             = 'PersonalEnglishLib'
  s.version          = '0.1.0'
  s.summary          = '這是一個說英語很牛逼的框架,逼很牛,你忍一下'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://github.com'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { ‘XX’ }
  s.source           = { :git => 'https://github.com/JW-chenjingwei/PersonalEnglishLib.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '13.0'
  s.swift_version = '5.0'
  s.source_files = 'PersonalEnglishLib/Classes/**/*'
  
  # s.resource_bundles = {
  #   'PersonalEnglishLib' => ['PersonalEnglishLib/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end
12. 可能會出現(xiàn)的錯誤提示,要求輸入github賬號密碼時提示需要使用access tokens,解決方法就是在github的devlep settiing里創(chuàng)建access tokens,在電腦里的鑰匙串中搜索github,刪除之前保存的github賬號密碼,下次要求輸入密碼的時候輸入access tokens即可
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 最近在學(xué)習(xí)vue.js的時候發(fā)現(xiàn),vue的組件化的思想對于編寫代碼是一個非常有用的事情。 首先為什么需要組件化? ...
    helloWalle閱讀 2,814評論 0 6
  • 組件化的優(yōu)點 為什么需要組件化開發(fā)?1.將不同功能、模塊的代碼分離出來,有利于大型項目的解耦,像插件似的組裝整個復(fù)...
    許久以前閱讀 662評論 2 3
  • 最近在學(xué)習(xí)vue.js的時候發(fā)現(xiàn),vue的組件化的思想對于編寫代碼是一個非常有用的事情。 首先為什么需要組件化? ...
    拂曉的云閱讀 7,361評論 6 23
  • 最近剛換一個新公司,比較清閑些,就搜索了一些私有pod的制作資料,發(fā)現(xiàn)現(xiàn)有的一些文章大多數(shù)重在思想而忽略了實戰(zhàn)細節(jié)...
    summer_maimaiti閱讀 894評論 0 0
  • 因項目業(yè)務(wù)的不斷發(fā)展,應(yīng)用的代碼體積越來越大,代碼耦合也較為嚴重,所以考慮先對各模塊進行解耦,然后通過pod私有庫...
    炎成閱讀 8,646評論 2 23

友情鏈接更多精彩內(nèi)容