“no such module” when Importing pods in swift playground

折月煮酒 提交于 2019-11-28 02:35:46

问题


Using Xcode 7.2.1.

I am following this tutorial to get pods working in playground. i have added the playground into the workspace, and the podfile is linking to the playground.

But importing still does not work - "no such module"

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

// import does not work

// Podfile
target 'spaceships' do
end

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

https://github.com/mingyeow/ImportToPlaygroundDoesNotWork


回答1:


Not a direct answer to the issues you get from this tutorial, but there's a new tool to automatically generate Playgrounds with pods that I often use.

It's called ThisCouldBeUsButYouPlaying and the source is on GitHub.

Basically it extends the CocoaPods installer, which is then able to generate Playgrounds.

Install:

$ gem install cocoapods-playgrounds

Create a Playground with Alamofire:

$ pod playgrounds Alamofire

Create a Playground with multiple pods:

$ pod playgrounds RxSwift,RxCocoa

The new Playground will automatically open.

You will have to first build the project, to enable the pods, then the Playground will be available.



来源:https://stackoverflow.com/questions/35818642/no-such-module-when-importing-pods-in-swift-playground

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!