How can I create a playground book that I can edit in the Swift Playgrounds app?

I would like to create a playground book in which I enter code on the iPad.

I have an iMac in mid 2011 with macOS 10.13.

Is that possible?

If possible, how would you proceed?

The Swift Playgrounds app is available on both macOS and iOS and can be downloaded from the App store on either platform. There are different starting points that can be used as a base to build on.
If you are asking about running Swift Playgrounds on macOS 10.13 without updating to a later version of the OS, unfortunately no. Swift Playgrounds requires features that are only present in macOS Catalina 10.15.
You can use the Swift Playgrounds Author Template for Xcode, which you can download from here:
https://developer.apple.com/download/more/?=Swift%20Playgrounds%20Author

There's also a session at this year's WWDC to tell you more (and maybe show off a new way to do it?):
https://developer.apple.com/wwdc20/10654
How can I create a playground book that I can edit in the Swift Playgrounds app?
 
 
Q