在工程 workspace下 可以import 使用cocoapods导入的第三方库 ,但是 无法引用到 自定义的类
playground 何必这么认真呢 本身就是一个学习代码的工具
非要引入
自己编译成framework
OS X Playground 加入到: /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks
iOS加入到: /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/
就可以了
这里还有个方法
http://stackoverflow.com/questions/33144877/playground-import-no-such-module-foo
我没试过~
2 回答643 阅读
552 阅读
新建一个本地的 CocoaPod 应该可以解决你的问题~
具体来说就是在你的电脑上新建一个本地的 pod,再在你的 Playground 的
podfile
中指定在本地 pod 里安装这个库(而不是从 CocoaPods 的中央库)。创建本地库
这一步的前提是你已经给你的库使用了 git。在你的库的目录下新建一个
.podspec
文件,这里假设是/你的库的路径/podLocalTest.podspec
,文件的内容这样写:引用这个本地 pod
在你需要安装这个库的
podfile
里:然后执行
pod install
就可以啦~