Skip to content
CTS Blog
Menu
  • About
  • RSS Feed
Menu

Challenge: Create amazing documentation

Posted on June 10, 2021
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? Check out the Developer Tools Digital Lounges. On Thursday from 1 p.m. – 5 p.m. PDT, drop by the Developer Tools Study Hall in the #devtools-study-hall channel to share your progress, ask questions about your project, and collaborate with others. You can also share your progress on the Developer Forums using the tag “WWDC21-Challenges,” or on social media using the hashtag #WWDC21Challenges.

Resources

Documenting a Swift Framework or Package

Read the WWDC21 Challenges Terms and Conditions

Powered by WPeMatico

Categories

Recent Posts

  • Dell XPS 14 review: Built for endurance, not speed
  • Still using Discord? Turn off these 5 settings right now
  • Capcom Spotlight Presentation Set For Later This Week — Here’s What Will Be Shown
  • ‘We Don’t Nickel-and-Dime People to Death’ — Warhammer 40,000: Space Marine 2 Isn’t a Live Service Game, Tim Willits Says, It’s Something Else
  • Why the essential Baseus PicoGo AM52 power bank shows how Qi2.2 should be done

Recent Comments

    Archives

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    ©2026 CTS Blog | Design: Newspaperly WordPress Theme