SuggestedActionsMessage
NewiOSmacOSpublic struct SuggestedActionsMessage : SendableA representation of the message you use as context for suggested actions.
Create a SuggestedActionsMessage from your app's data model for a message, then pass it to init(message:previousMessages:) or generate(message:previousMessages:).
The id you pass to the create a SuggestedActionsMessage must be unique for each message and stable across app launches. Creating stable identifiers lets the framework match messages against previously cached suggested actions.
Note: To use the Suggested Actions framework, add the
<doc://com.apple.documentation/documentation/bundleresources/entitlements/com.apple.developer.suggested-actions> entitlement to your app target.
Declaration
public struct SuggestedActionsMessage : Sendable {
/// Creates a representation of a message that the system uses to display suggested actions.
///
/// - Parameters:
/// - id: A stable, unique identifier for the message. Common types for this identifier are
/// `String`, `UUID`, or a custom identifier type, but any `Hashable`
/// value works. The identifier must remain consistent across the lifetime of
/// the message and across app launches.
/// - date: The date when the sender sent the message or the date your app
/// received it.
/// - subject: The subject line of the message.
/// - body: The body content of the message.
/// - sender: The participant who sent the message.
/// - recipients: The participants who received the message.
@available(macOS 27.0, iOS 27.0, *)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public init(id: some Hashable, date: Date, subject: AttributedString?, body: AttributedString, sender: SuggestedActionsMessage.Participant, recipients: [SuggestedActionsMessage.Participant])
}