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.
2 Answers
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.
-
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... Sep 13, 2018 at 1:50
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