将Objective-C pod作为依赖项导入Swift pod

时间:2018-02-20 21:21:02

标签: objective-c swift cocoapods podspec

  • 这两个都是Cocoapods私人吊舱
  • 我需要将它们用作开发窗

1 个答案:

答案 0 :(得分:0)

<强> .podspec:

Pod::Spec.new do |spec|
  spec.name = 'MyMainPod'
  spec.dependency 'MyObjCSubPod'
  ...
end

<强> Podfile:

pod 'MyMainPod', :path => 'private-pods/my-main-pod/'
pod 'MyObjCSubPod', :path => 'private-pods/my-main-pod/my-objc-subpod'

<强> SomeFile.swift:

import MyObjCSubPod

无需额外的桥接标头。