- cd 到你要存放的文件夾下面 執(zhí)行
pod lib create +項目名
2.創(chuàng)建podspec民鼓、LICENSE等文件
Press return to continue.
What platform do you want to use?? [ iOS / macOS ]
> iOS
# 選擇編程語言
What language do you want to use?? [ Swift / ObjC ]
> ObjC
# 在你的項目中是否創(chuàng)建一個demo工程
Would you like to include a demo application with your library? [ Yes / No ]
> No
# 測試框架選擇哪一個
Which testing frameworks will you use? [ Specta / Kiwi / None ]
> None
# 要不要做視圖測試
Would you like to do view based testing? [ Yes / No ]
> Yes
Putting demo application back in, you cannot do view tests without a host application.
# 類前綴名
What is your class prefix?
> YJ
這時pod庫已生成
- YJUIKIt.podspec 說明
#
# Be sure to run `pod lib lint YJUIKIt.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
#跟podspec文件名相同
s.name = 'YJUIKIt'
#版本
s.version = '0.1.0'
#庫的簡介
s.summary = 'A short description of YJUIKIt.'
# 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/xxxx/YJUIKIt'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
#MIT是一個比較寬泛的開源許可協議
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'xxxx' => 'xxxx@qq.com' }
#代碼倉庫的地址
s.source = { :git => 'https://github.com/xxxx/YJUIKIt.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '9.0'
#規(guī)范支持的CocoaPods版本
s.cocoapods_version = '>= 0.36'
#pod庫的源文件
s.source_files = 'YJUIKIt/Classes/**/*'
# s.resource_bundles = {
# 'YJUIKIt' => ['YJUIKIt/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
介紹的只是本地的pod庫 并不關聯遠程倉庫 若要管理 也很簡單 這里就不記錄了。