在swift playground中导入pod时"没有这样的模块"

min*_*eow 1 xcode cocoapods swift-playground

使用Xcode 7.2.1.

我正在按照本教程让pods在游乐场工作.我已将操场添加到工作区中,并且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'
Run Code Online (Sandbox Code Playgroud)

https://github.com/mingyeow/ImportToPlaygroundDoesNotWork

aya*_*aio 9

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

它叫做ThisCouldBeUsButYouPlaying,源代码在GitHub上.

基本上它扩展了CocoaPods安装程序,然后它可以生成Playgrounds.

安装:

$ gem install cocoapods-playgrounds
Run Code Online (Sandbox Code Playgroud)

使用Alamofire创建一个游乐场:

$ pod playgrounds Alamofire
Run Code Online (Sandbox Code Playgroud)

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

$ pod playgrounds RxSwift,RxCocoa
Run Code Online (Sandbox Code Playgroud)

新的Playground将自动打开.

您必须首先构建项目,启用pod,然后Playground将可用.

在此输入图像描述