Add content to a playground book by creating new folders and property lists.
Combine playground books, chapters, pages, Swift modules, and cutscenes to provide a logical narrative or instructional structure to your content. For example, you can:
Use books to package root-level Swift Playgrounds content.
Use chapters to group pages and cutscenes within a book.
Use pages to write the primary teaching or exploratory content of the book.
Use modules to implement live views and provide the APIs learners write code against.
Provide user-editable modules to give learners a space to store and reuse code.
Intersperse cutscenes with pages to introduce or summarize concepts.
Each part of a playground book must include a manifest property list that contains metadata and references to shared resources.
Determine Book-Level Information
You write key details about a playground book in its
Manifest file. The Swift Playgrounds Author Template comes with a default manifest that you update with specific details about your book, like its title and the file path for the cover image.
You use the book-level manifest to configure the following properties:
Required. An array of strings you use to order the chapters in a book. Each string is the name of a
.playgroundchapterdirectory that contains the content and resources for a chapter.
Required. A string that uniquely identifies your book among all others. The identifier must be in reverse-DNS format, and you should use a domain that you or your organization controls. For example, if you own
example, you might set a book’s
Required. A string containing the version number of a book. The string can only contain sequences of numbers and periods, such as
2. Increment the version of the book when you publish updates to it.
Required. A string that contains the minimum version of iOS (10.0 or later) required to run your book. You prefix the version number with the string
ios. For example, the version string for iOS 11.3 is
A string containing a reference to a
.pngimage file that’s stored in the book’s Resources folder and used as the book icon. The icon must be an image with a 4:3 aspect ratio. The recommended image size is 400 × 300 pixels.
Required. A string you use to provide a title for a book. This title becomes the learner-facing name displayed in Swift Playgrounds.
Required. A string containing the version of the Swift Playgrounds book format used to write the book. Use
A string containing the version of Swift that the playground book uses. The default is
Swift Playgrounds Version
A string containing the minimum version of the Swift Playgrounds app that your book requires. The default is
Required. A string you use to determine the degree to which a learner has control over user-editable modules in the book. The module mode must be one of the following types:
"Full"—User-editable modules that the user can add and remove as needed.
"Limited"—A nonremovable user module that you supply with your book.
"Disabled"—No user-editable modules are available.
This property is available starting with Swift Playgrounds 3.