CocoaPods日常使用

Pod命令

升级CocoaPods

sudo gem install cocoapods 

Podfile 文件配置

代码来源

# open source
source 'https://github.com/CocoaPods/Specs.git'
# my work
source 'https://github.com/xxx/Specs.git'

# 平台版本信息
platform :ios, '9.0'
use_frameworks!

target 'ZMImageBrowser_Example' do
  #主程序需要引入的三方库
  pod 'ZMImageBrowser', :path => '../'
  pod 'MBProgressHUD'

  #Test 需要引入的三方库
  target 'ZMImageBrowser_Tests' do
    inherit! :search_paths

    pod 'FBSnapshotTestCase' , '~> 2.1.4'
  end
end


创建私有库

创建Pods工程

pod lib create ZMImageBrowser

控制台日志及选项如下:


278814-19280930303711a7.png

私有库podspec配置

Pod::Spec.new do |s|
  s.name             = 'ZMImageBrowser'
  s.version          = '0.1.0'
  s.summary          = 'A short description of ZMImageBrowser.'
  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://github.com/z251257144/ZMImageBrowser'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'z251257144' => '[email protected]' }
  s.source           = { :git => 'https://github.com/z251257144/ZMImageBrowser.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '9.0'

  s.source_files = 'ZMImageBrowser/Classes/**/*'
  
  # s.resource_bundles = {
  #   'ZMImageBrowser' => ['ZMImageBrowser/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  
  s.frameworks = 'UIKit', 'ImageIO', 'QuartzCore', 'AssetsLibrary', 'MediaPlayer'
  
  s.dependency 'MBProgressHUD'
  s.dependency 'DACircularProgress'
  s.dependency 'SDWebImage'
  
end

猜你喜欢

转载自blog.csdn.net/weixin_33716941/article/details/90918821