I am using Xcode Playgrounds to make tutorials about Swift. I was wondering, can I put multiple playground files into one Xcode workbook? I want one workbook with multiple playground tutorials in it.
Asked
Active
Viewed 2,561 times
4
-
1You can add multiple source files in a playground yes, not sure about workbook? – Scriptable Sep 11 '18 at 12:31
2 Answers
16
You can right click on your top level file and select the "New Playground Page" button, which will give you a separate page.
The below image shows the new page created after you click that button. "Untitled Page" is the initial page, and "Untitled Page 2" is the new page.

Papershine
- 4,995
- 2
- 24
- 48
-
Thanks for the help, That works! Ok, now I would like to make links to topics within my playgrounds. So instead of going [Next] (@next) which brings me to the next page, can I do the same but send me to a topic within that same page? Basically, I want to go back to a class and add code for additional properties or functions. Say, that I am further along in the tutorial and want to quickly link back to the top... – Rob Fitzgerald Sep 13 '18 at 01:50
3
You can create either Empty Project
or Workspace
to manage your multiple playground files under one roof.
1. Empty Project:
File -> New -> Project
- Choose
Other
and SelectEmpty
- Create/Add Your Playground files to the workspace by right clicking on the
Project Navigator
2. Workspace:
File -> New -> Workspace
- Create/Add Your Playground files to the workspace by right clicking on the
Project Navigator

Suryavel TR
- 3,576
- 1
- 22
- 25