CocoaPods和更新的(iOS 8)API?

时间:2014-08-10 01:15:17

标签: ios objective-c xcode cocoapods xcode-tools

我有一个库,我正在尝试推送到CocoaPods主干,但它不会对iOS 7 SDK有所影响,因为它包含iOS 8 API调用。

将podspec的版本更改为8.0不执行任何操作,并且linter尝试针对7.1进行构建,但失败了。如何在iOS 8测试版中将cocoapods linter更改为lint?

修改

我使用pod trunk push my.podspec选项运行--verbose命令,并在日志中看到这一点:

  

===构建TARGET Pods-MBPlacePickerController OF PROJECT Pods with the DEFAULT   配置(发布)===

     

检查依赖项   架构'arm64'和变体'normal'的iOS部署目标'8.0'大于> iOS 7.1 SDK的最大值“7.1.99”。

这是我的podspec:

Pod::Spec.new do |s|

  s.name         = "MBPlacePickerController"
  s.version      = "2.2.2"
  s.summary      = "An open source place picker for iOS."
  s.description  = <<-DESC
    A view controller for picking a location. I wrote it to be a simple wrapper around automatic location detection, but also to offer manual location selection in case GPS isn't available.
                   DESC
  s.homepage     = "https://github.com/MosheBerman/MBPlacePickerController"
  s.screenshots  = "https://raw.github.com/MosheBerman/MBPlacePickerController/master/screens/2.2.0/Readme/Default-Dark.png"
  s.author       = { "Moshe Berman" => "moshberm@gmail.com" }
  s.license      = 'MIT'
  s.platform     = :ios, '8.0'
  s.source       = { :git => "https://github.com/MosheBerman/MBPlacePickerController.git", :tag => "2.2.2"} 
  s.source_files  = 'Classes', 'MBPlacePickerController/MBPlacePickerController/**/*.{h,m}'
  s.frameworks = 'QuartzCore'
  s.weak_framework = 'CoreLocation'
  s.requires_arc = true
end

1 个答案:

答案 0 :(得分:2)

您需要在pod规范中包含以下行:

s.platform = :ios, '8.0'

8.0指的是部署目标,因此只有部署目标是iOS 8.0,其他开发人员才能通过CocoaPods使用您的库。

此外,由于iOS 8.0仍处于测试阶段,因此Xcode 6也是如此,您需要运行以下命令:

sudo xcode-select --switch /Applications/Xcode6-Beta5.app/Contents/Developer