如何在我自己的Cocoa Pod框架中添加Google Map Cocoa Pod [英] How to add Google Map Cocoa Pod in my own Cocoa Pod Framework

查看:65
本文介绍了如何在我自己的Cocoa Pod框架中添加Google Map Cocoa Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一些Framework并使用可可豆荚进行分发.我需要在我的框架中使用GoogleMap Cocoa Pod.我将如何添加它们.

I am creating some Framework and used cocoa pods for distribution . I need to use the GoogleMap Cocoa Pod in my Framework. How will I add them.

我已经在我的podspec文件中添加了s.dependency'GoogleMaps',但是它将在使用我的cocoapod的应用程序中安装可可豆荚.如何在框架中使用GoogleMaps功能.我正在用Swift开发它,

I already add s.dependency 'GoogleMaps' in my podspec file, but it will install the cocoa pod in the application which will use my cocoapod. How can I use GoogleMaps funtionality in my framework. I am developing it in Swift,

推荐答案

这是来自较旧框架的Podfile,在该框架中,我同时使用了私有Pod和Public Pod.Podfile应该像您创建的任何项目一样正常.

This is Podfile from my older framework in which I used both private pods and public pods. Podfile should be normal like in any project you make.

platform :ios, '8.0'
use_frameworks!

workspace "SampleApp"
project "FrameworkName.xcodeproj"

# Private pods Spec repository
source 'https://path_to_your_private_pods'
# Public spec repository
source 'https://github.com/CocoaPods/Specs.git'

target :FrameworkName do
    xcodeproj "FrameworkName.xcodeproj"

   // PUBLIC PODS 
   pod 'GoogleMaps'

   // PRIVATE PODS 
   pod 'PrivatePod', :git => 'git@path_to_your_private_pod', :branch => 'branch-name'
end

(您可以将其更新为更新的sintax)

(You can update it to newer sintax)

此外,您还必须创建podspec文件,在其中定义依赖关系:

Also, you must create podspec file in which you will define your depencencies:

Pod::Spec.new do |spec|
  spec.name             = 'SampleApp'
  spec.version          = '0.1.0'
  spec.license          = { :type => 'BSD' }
  spec.homepage         = 'http://www....'
  spec.authors          = { 'Author' => 'Email' }
  spec.summary          = 'Summary'
  spec.source           = { :git => 'https://PATH_TO_REPOSITORY', :tag => spec.version.to_s }
  spec.source_files     = 'SampleApp'
  spec.requires_arc     = true
  spec.ios.deployment_target = '8.0'
  spec.resources        = ["some_path_to_resources/*.png"]

  spec.dependency 'GoogleMaps'
end

Podspec的spec.dependency部分是最重要的部分,因为它将读取您所有的框架依赖项.

Podspec spec.dependency part IS THE MOST IMPORTANT becouse from it all your framework dependencies will be read.

这篇关于如何在我自己的Cocoa Pod框架中添加Google Map Cocoa Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆