First impressions of Swift Playground for cats and cats (1)
Playground introduction to creating Playground
Open xcode, select the first one, and then click Next to create a Demo of the Playground exercise code.
The page that appears after the application is created is divided into several areas in our Playground. 1: code area. 2: preview area
The code written in the code area can be viewed directly in the preview area. Of course, the display time of this effect depends on the Compilation Time of the machine. Simply put, if you are using the latest version of the 15-inch MPO top configuration with a small 20 thousand configuration, it is basically as smooth as silk. If you are using a simulator to open a black apple, it would be worse than shit... Just like this, let's look at chrysanthemum.
Here I use Swift to initialize a Button
When the compilation is complete, the preview is okay.
Playground Preview
Then I set the frame and its background color for this btn so that we can see him. In addition, playground has many useful small functions. The rightmost eye click will pop up a window to show the preview effect. After clicking the white point on the right of the eye, it will become a plus sign, and some preview effects will be added to the bottom of the Code.
Playground Console
Swift loop, where the console opens
Supplement
We can write a playground demo set by ourselves, which can be opened at this position or press the shortcut key command + 0.