swift - 使用 Swift 的私有(private) Cocoapod

标签 swift frameworks cocoapods

尝试做一个小型私有(private) pod 供内部使用(将成为私有(private) git 存储库的一部分),但遇到了类对使用该 pod 的工作空间不可见的问题。这是我的 podspec:

Pod::Spec.new do |s|
s.name = "DBKit"
s.version = "1.0.0"
s.summary = "Core Data library"
s.platform = :ios, '8.0'
s.requires_arc = true
s.author = { "John Doe" => "support@myemail.com" }
s.homepage      = "mywebpage.com"
s.license          = { :type => 'MIT', :file => 'LICENSE' }
s.source   = { :git => "https://git.mycomany.com/scm/lss/dbkit-ios.git" }
s.framework = "UIKit"
s.source_files = 'DBKit/**/*.swift'
end

我有一个测试项目,我正尝试在其中使用 pod。这是 Podfile:

platform :ios, 8.0

use_frameworks!

def devPods
pod 'DBKit', :path => '~/Dev/Libraries/DBKit'
end

target 'SwiftCoreData' do
    devPods
end

我看到的错误是“使用未解析的标识符‘CDManager’”

截图如下: Errors

我在该项目中使用了相同的类,没有遇到任何问题。我知道 pod 中的类和方法都很好,问题是包含 pod 的项目看不到这些方法。我确实对 DBKit 的导入语句有了智能感知。

两个项目(pod 和使用 pod 的项目)都专门使用 Swift。

有什么想法吗?

最佳答案

像个笨蛋一样,我懒得公开类(class)。这样做并公开相关方法就解决了这个问题。

关于swift - 使用 Swift 的私有(private) Cocoapod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47046248/

相关文章:

ios - 如何从我的 podfile 中找到 GitHub 项目?

swift - 未找到框架 StringScore_Swift

ios - 是否可以从 CLI 命令应用 "Update to recommended settings"?

javascript - Coffeescript html5 Canvas 库

swift - 在swift中将可测试代码与静态方法调度结合起来

ios - 如何正确地将 UITextField 添加到 UITableViewCell

swift - Xcode 10/iOS 12 中不遵守 anchor 约束

css - 如何在 application.css 中正确设置 "require"? (骨架框架)

xcode - 我如何在 Xcode 4 中得到 "add existing frameworks"?

swift - Firebase:如何将数据放入已使用 childbyAutoID 创建的子对象中