如何让你的Pod库同时支持多个设备

如何让你的Pod库同时支持多个设备

Pod::Spec.new do |s|
  s.name     = 'AFNetworking'
  s.version  = '3.1.0'
  s.license  = 'MIT'
  s.summary  = 'A delightful iOS and OS X networking framework.'
  s.homepage = 'https://github.com/AFNetworking/AFNetworking'
  s.social_media_url = 'https://twitter.com/AFNetworking'
  s.authors  = { 'Mattt Thompson' => 'm@mattt.me' }
  s.source   = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => s.version, :submodules => true }
  s.requires_arc = true

  s.public_header_files = 'AFNetworking/AFNetworking.h'
  s.source_files = 'AFNetworking/AFNetworking.h'

  s.ios.deployment_target = '7.0'
  s.osx.deployment_target = '10.9'
  s.watchos.deployment_target = '2.0'
  s.tvos.deployment_target = '9.0'
end

参考AFNetworking

只需要添加需要的 deployment_target 就可以
比如需要同时支持ios和osx时 只需要添加

s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'

即可

同理 比如需要各自支持

只需要这样写

s.ios.xx = ''
s.ios.xxx = ''

s.osx.xx = ''
s.osx.xxx = ''
坚持原创技术分享,您的支持将鼓励我继续创作!