Contents

HomeContentID

An identifier for a piece of content that your extension provides.

Declaration

struct HomeContentID

Overview

Defining identifiers as constants, instead of using strings, lets you reuse them and avoid typos. For example:

extension HomeContentID {
    static let batteryGuide: HomeContentID = "battery-guide"
}

HomeAccessoryHelpGuide(id: .batteryGuide) {
    BatteryGuideView()
}

You can also use a string literal anywhere an identifier is expected.

Topics

Creating a content identifier

See Also

Guides and troubleshooting content