© Jesse Feiler 2017

Jesse Feiler, Exploring Swift Playgrounds, 10.1007/978-1-4842-2647-6_9

9. Building a Complex Playground

Jesse Feiler

(1)Plattsburgh, New York, USA

The playgrounds you’ve seen in the other chapters of this book are one page long (page means a playground page and not necessarily a printed page). The heart of each playground page is the code that assigns the live view of the current page to a view or view controller that contains the playground page:

PlaygroundPage.current.liveView = your playground view        

Remember that technically the current page can be any object that conforms to the PlaygroundLiveViewable protocol. Objects that conform to this protocol include UIView, UIViewController, NSView, and NSViewController. Subclasses ...

Get Exploring Swift Playgrounds: The Fastest and Most Effective Way to Learn to Code and to Teach Others to Use Your Code now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.