How to add a CocoaPod framework to Xcode 8 Playground

跟風遠走 提交于 2019-12-01 06:37:47

UPDATE

As of:

Xcode 8.2

You no longer need to add your pod folder into resources, simply use it as you would in the project.

Example:


Pre Xcode 8.1

Thanks to Eric Aya, I have found a solution based on his first suggestion.

In order to add a CocoPods framework to Playground, follow these steps:

  1. Add pods to your pod file and hit pod install
  2. Add a new Playground file
  3. Click on the Sources folder in your playground
  4. Click on the + for Add Files to Sources
  5. Add you pod folder, in our case HanakeSwift
  6. Import your project pods framework import Pods_PodsPlayground
  7. Build and access your framework!

Step 3

Step 4

Step 5

Step 6, 7

In Xcode 8.2:

  1. Click on your project name in the left column
  2. Click "New File" and choose "Playground"
  3. Import the pod that you have installed in your Podfile
  4. Possibly do a build and run to get rid of the error if it temporarily can't find the pod
  5. That's it! You should be good to go
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!