【问题标题】:"no such module" when Importing pods in swift playground在 Swift Playground 中导入 pod 时出现“没有这样的模块”
【发布时间】:2016-03-05 19:16:00
【问题描述】:

使用 Xcode 7.2.1。

我正在按照本教程让 Pod 在 Playground 中工作。我已将操场添加到工作区中,并且 podfile 正在链接到操场。

但导入仍然不起作用 - “没有这样的模块”

https://littlebitesofcocoa.com/138-using-cocoapods-in-xcode-playgrounds

//导入不起作用

// Podfile
target 'spaceships' do
end

platform :ios, '9.0'
use_frameworks!
link_with 'spaceships', 'imports', 'test'

https://github.com/mingyeow/ImportToPlaygroundDoesNotWork

【问题讨论】:

    标签: xcode cocoapods swift-playground


    【解决方案1】:

    不是对您从本教程中获得的问题的直接答案,但有一个新工具可以自动生成带有我经常使用的 Pod 的 Playgrounds。

    它叫ThisCouldBeUsButYouPlaying,来源是on GitHub

    基本上它扩展了 CocoaPods 安装程序,然后能够生成 Playgrounds。

    安装:

    $ gem install cocoapods-playgrounds
    

    使用 Alamofire 创建游乐场:

    $ pod playgrounds Alamofire
    

    创建一个包含多个 pod 的 Playground:

    $ pod playgrounds RxSwift,RxCocoa
    

    新的游乐场将自动打开。

    您必须首先构建项目以启用 pod,然后才能使用 Playground。

    【讨论】:

    • 这真是太棒了。和 best.name.ever。
    • 此项目现已存档,未维护。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-24
    • 1970-01-01
    • 2017-03-05
    • 1970-01-01
    相关资源
    最近更新 更多