ActivityAttributes
protocol · iOS 16.1+ · SDK 27.1
protocol ActivityAttributes : Decodable, EncodableThe protocol you implement to describe the content of a Live Activity. The `ActivityAttributes` protocol describes the content that appears in your Live Activity. Its inner type ``ActivityKit/ActivityAttributes/ContentState`` represents the dynamic content of the Live Activity. The following example shows an implementation of the `ActivityAttributes` protocol for a pizza delivery app. The app's Live Activity shows the number of ordered pizzas and the total amount on the bill as static data and the name of the driver and an estimated delivery time as dynamic data that changes over time. Note how the implementation defines the type alias `PizzaDeliveryStatus` to make the code more descriptive and easier to read. ```swift public import Foundation import ActivityKit struct PizzaDeliveryAttributes: ActivityAttributes { public typealias PizzaDeliveryStatus = ContentState public struct ContentState: Codable, Hashable { var driverName: String var deliveryTimer: ClosedRange<Date> } var numberOfPizzas: Int var totalAmount: String var orderNumber: String } ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.