Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 Developer Tools

WWDC22 · 18 min · Developer Tools

What’s new in Swift-DocC

Join us for an exciting update on Swift-DocC and learn how you can write and share documentation for your own projects. We’ll explore improvements to Swift-DocC navigation and share how you can compile documentation for application targets and Objective-C code. We’ll also show you how to publish your content straight to hosting services like GitHub Pages.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 4 snippets

Documenting the SlothView struct swift · at 3:21 ↗
/// A view that displays a sloth.
///
/// This is the main view of ``SlothyApp``.
/// Create a sloth view by providing a binding to a sloth.
///
/// ```swift
/// @State private var sloth: Sloth
///
/// var body: some View {
///     SlothView(sloth: $sloth)
/// }
/// ```
struct SlothView: View {
    // ...
}
Documenting an initializer swift · at 4:25 ↗
struct SlothView: View {
    /// Creates a view that displays the specified sloth.
    ///
    /// - Parameter sloth: The sloth the user will edit.
    init(sloth: Binding<Sloth>) {
				// ...
    }
}
Documenting the SLOSound Objective-C class objectivec · at 5:24 ↗
/// A sound that can be played.
///
/// Use an instance of this type to play a sound
/// to the user in response to an action or
/// event.
@interface SLOSound : NSObject

/// Creates a sound given its name and path on
/// disk.
///
/// - Parameters:
///   - name: The name of the sound.
///   - filePath: The path to the sound file on disk.
- (id)initWithName:(NSString *)name
          filePath:(NSString *)filePath;

@end
Documenting the top-level page for the Slothy app markdown · at 6:48 ↗
# ``Slothy``

An app to create and care for custom sloths.

## Overview

Slothy is an iOS app that allows users to create and care for virtual sloths.

![An illustration displaying the UI for finding, creating, and taking care of a sloth in Slothy.](slothy.png)

The Slothy app project contains views to present Slothy's user interface, and utilities to play sounds as the user interacts with the app.

Resources