View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Meet DocC documentation in Xcode

    Discover how you can use DocC to build and share documentation for Swift packages and frameworks. We'll show you how to begin generating documentation from your own code — or from third-party code you depend upon — and write and format it using Markdown. And we'll also take you through the export process, helping you generate DocC archives to share with the public.

    Ressources

    • Formatting your documentation
    • Writing symbol documentation in your source files
    • SlothCreator: Building DocC documentation in Xcode
    • Documenting a Swift Framework or Package
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC23

    • Create rich documentation with Swift-DocC

    WWDC21

    • Build interactive tutorials using DocC
    • Elevate your DocC documentation in Xcode
    • Host and automate your DocC documentation
    • What‘s new in Swift
  • Rechercher dans cette vidéo…
    • 9:34 - Existing comments in code

      // A model representing a sloth.
      public struct Sloth {
          // ...
      }
    • 10:05 - Writing documentation comments

      /// A model representing a sloth.
      public struct Sloth {
          // ...
      }
    • 10:22 - Writing block-style documentation comments

      /** 
       A model representing a sloth.
       */
      public struct Sloth {
          // ...
      }
    • 11:34 - Documenting the Food struct

      /// Food that a sloth can consume.
      ///
      /// Sloths love to eat the leaves and twigs they find in the rainforest canopy as they
      /// slowly move around. To feed them these items, you can use the `twig`,
      /// `regularLeaf` and `largeLeaf` default foods.
      ///
      /// ```swift
      /// superSloth.eat(.twig)
      /// ```
      public struct Food {
      		// ...
      }
    • 13:58 - Documenting the Sloth.sleep(in:for:) method

      /// A model representing a sloth.
      public struct Sloth {
          /// Sleep in the specified habitat for a number of hours.
          ///
          /// - Parameters:
          ///     - habitat: The location for the sloth to sleep.
          ///     - numberOfHours: The number of hours for the sloth to sleep.
          /// - Returns: The sloth’s energy level after sleeping.
          mutating public func sleep(in habitat: Habitat, for numberOfHours: Int = 12) -> Int {
              energyLevel += habitat.comfortLevel * numberOfHours
              return energyLevel
          }
      }
    • 15:39 - Documenting the Sloth.eat(_:quantity:) method

      /// A model representing a sloth.
      public struct Sloth {
          /// Eat the provided specialty sloth food.
          ///
          /// Sloths love to eat while they move very slowly through their rainforest habitats. They
          /// are especially happy to consume leaves and twigs, which they digest over long periods
          /// of time, mostly while they sleep.
          ///
          /// ```swift
          /// let flower = Sloth.Food(name: "Flower Bud", energy: 10)
          /// superSloth.eat(flower)
          /// ```
          ///
          /// - Parameters:
          ///   - food: The food for the sloth to eat.
          ///   - quantity: The quantity of the food for the sloth to eat.
          /// - Returns: The sloth's energy level after eating.
          mutating public func eat(_ food: Food, quantity: Int = 1) -> Int {
              energyLevel += food.energy * quantity
              return energyLevel
          }
      }
    • 17:46 - Adding symbol links to the documentation for Sloth.sleep(in:for:)

      /// A model representing a sloth.
      public struct Sloth {
          /// The energy level of the sloth.
          public var energyLevel: EnergyLevel
      
          /// Sleep in the specified habitat for a number of hours.
          ///
          /// Each time the sloth sleeps, their ``energyLevel`` increases every hour by the
          /// habitat's ``Habitat/comfortLevel``.  
          ///
          /// - Parameters:
          ///     - habitat: The location for the sloth to sleep.
          ///     - numberOfHours: The number of hours for the sloth to sleep.
          /// - Returns: The sloth’s energy level after sleeping.
          mutating public func sleep(in habitat: Habitat, for numberOfHours: Int = 12) -> Int {
              energyLevel += habitat.comfortLevel * numberOfHours
              return energyLevel
          }
      }
    • 18:44 - Adding symbol links to the documentation for Sloth.eat(_:quantity:)

      /// A model representing a sloth.
      public struct Sloth {
          /// Eat the provided specialty sloth food.
          ///
          /// Sloths love to eat while they move very slowly through their rainforest habitats. They
          /// are especially happy to consume leaves and twigs, which they digest over long periods
          /// of time, mostly while they sleep.
          ///
          /// ```swift
          /// let flower = Sloth.Food(name: "Flower Bud", energy: 10)
          /// superSloth.eat(flower)
          /// ```
          ///
          /// When they eat food, a sloth's ``energyLevel`` increases by the food's
          /// ``Food/energy``. 
          ///
          /// - Parameters:
          ///   - food: The food for the sloth to eat.
          ///   - quantity: The quantity of the food for the sloth to eat.
          /// - Returns: The sloth's energy level after eating.
          mutating public func eat(_ food: Food, quantity: Int = 1) -> Int {
              energyLevel += food.energy * quantity
              return energyLevel
          }
      }

Developer Footer

  • Vidéos
  • WWDC21
  • Meet DocC documentation in Xcode
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines