cocoaPods pod文件与外部库

时间:2016-07-13 21:46:47

标签: ios cocoapods

我有这个pod文件:

# Uncomment this line to define a global platform for your project
platform :ios, ‘9.0’

inhibit_all_warnings!
use_frameworks!

target 'testthing' do
pod 'Alamofire', '~> 3.1.2'

end

没什么特别的。但我想链接Startapp,所以我发现这个代码与pods一起使用:

Pod::Spec.new do |s|

  s.name         = "StartApp"
  s.version      = "3.2.0"
  s.summary      = "StartApp SDK for iOS"

  s.description  = <<-DESC
                   StartApp SDK for iOS.
                   DESC

  s.homepage     = "https://www.startapp.com"

  s.license      = { :type => 'Apache License, Version 2.0', :text => <<-LICENSE
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    LICENSE
  }

  s.author             = { "StartApp" => "https://www.startapp.com" }

  s.platform     = :ios
  # s.platform     = :ios, "5.0"

  s.source       = { :http => "http://s3.startapp.com.s3.amazonaws.com/Resource/SDK_TEMP/IOS-InApp%20SDK-InApp-3.2.0.zip" }
  s.vendored_frameworks = "StartApp.framework"
  s.resource  = "StartApp.bundle"

  s.frameworks = "AdSupport", "StoreKit", "CoreTelephony", "SystemConfiguration", "CoreGraphics", "QuartzCore", "CoreMedia", "AVFoundation"
  s.library = "z"

end

但是如何将其整合到pod文件中,我已经尝试删除s并将其放在我的pod文件中,但这不起作用?

1 个答案:

答案 0 :(得分:1)

在podfile上层平台添加source 'http://s3.startapp.com.s3.amazonaws.com/Resource/SDK_TEMP/IOS-InApp%20SDK-InApp-3.2.0.zip',并在目标

下添加pod 'StartApp'