
Swift Essentials
By :

The playground has its own framework, XCPlayground
, which can be used to perform certain tasks. For example, individual values can be captured during loops for later analysis. It also permits asynchronous code to continue to execute once the playground has finished running.
It is possible to explicitly add values to the timeline by importing the XCPlayground
framework and calling XCPCaptureValue
with a value that should be displayed in the timeline. This takes an identifier, which is used both as the title and for group-related data values in the same series. When the value history button is selected, it essentially inserts a call to XCPCaptureValue
with the value of the expression as the identifier.
For example, to add the logo to the timeline automatically:
import XCPlayground XCPCaptureValue("logo",logo)
It is possible to use an identifier to group the data that is being shown in a loop with the identifier representing categories of...
Change the font size
Change margin width
Change background colour