Challenge: Create amazing documentation

Swift packages icon of brown box with swift icon on it

Explore Xcode's new documentation features and learn how to add documentation to your own framework or package — or to your favorite open source project. For this challenge, we’re asking you to create documentation for your own framework or package (or your favorite open source project). Use Xcode 13 to build documentation from the header comments in your Swift framework, and add a Documentation Catalog to organize your content.

Begin the challenge

Open up your project in Xcode, and start adding documentation comments in your source by using Swift DocC markdown syntax. DocC uses the comments you write in your source code as the content for the documentation pages it generates. At a minimum, add basic documentation comments to the framework’s public symbols for DocC to use as their single-sentence abstracts or summaries. Here’s an example:

/// A model representing a sloth.
/// Sloths are mammals noted for their slowness of movement. They spend most of their
/// lives hanging upside down in trees.
public struct Sloth {
    /// The species of the sloth.
    public var species: Species

Once you’ve finished your documentation, select Product > Build Documentation to generate your source docs for Quick Help and the Developer Documentation window.

Xcode documentation window displaying information about sloths

Need help writing or constructing your documentation? You can share your progress on the Developer Forums.

Visit the Apple Developer Forums


Read the WWDC21 Challenges Terms and Conditions