1.Playground Introduction
Playground is a fast-learning code model for Apple Xcode6, which does not have to be engineered to directly see the results of code execution, and has a unique advantage over rapid prototyping, as well as learning language details. The disadvantage is that there is no user interaction input.
I see the examples we use are written using OSX's Code and Class library (which is also the Mac OSX version of playground created by default using the shortcut menu). Looking at Apple's instructions, playground is supported by iOS.
So just look for, how to support the iOS class library.
2. Create Playground
First, when Xcode starts, it displays an interface. The first item above is "Get started with a playground"
Click to create a playground that you can use directly.
However, it is important to note that the Mac OSX version of Playground is created at this time. You can see it from the default referenced library.
Import Cocoa
3. Modify the newly created playground to iOS version.
Select the menu "View", "Utilities", "Show File Inspector", the right side of the window will display the file properties of the sidebar,
Note The playground settings part of the platform, currently Ox X, is changed to iOS.
Automatically generated code on the left after the change is complete. Import cocoa is not the right fit.
Modify the import UIKit used for iOS
In order to use Playground's instant display, you can
Import Xcplayground
This allows you to use the built-in Xcpcapturevalue to aggregate output values.
At this point, you can debug your iOS code with playground.
Note: Be careful next to that option: Resource path, which refers to the relative path of the resource file, if there is a local picture file that requires attention to this path.