ConversationUIContainer

Overview

The main conversation interface container for the Agentforce SDK. A SwiftUI view that provides a complete conversational AI interface with message display, user input, voice interaction, and multi-modal content.

Declaration

@MainActor struct ConversationUIContainer

Properties

Property Type Description
body some View The main view content (inherited from View)
alternateTitle String? Optional custom title to display in the conversation header

Methods

Method Signature Description
updateSession(session:) func updateSession(session: AgentConversation) throws Updates the conversation session with a new session instance
sendUtterance(_:) ⚠️ func sendUtterance(_ utterance: String) ⚠️ Deprecated: Messages should be sent using AgentforceConversation.sendUtterance
resetChat() ⚠️ func resetChat() ⚠️ Deprecated: The chat should be cleared using AgentforceConversation.reset
Inherited from View All View protocol methods Inherits all standard SwiftUI View methods and modifiers. See View (Apple Developer)

Integration Patterns

Modal Presentation

.sheet(isPresented: $showConversation) {
    ConversationUIContainer(
        viewModel: conversationViewModel,
        flagProvider: featureFlags,
        onClose: { showConversation = false }
    )
}

Navigation Integration

NavigationView {
    ConversationUIContainer(
        viewModel: conversationViewModel,
        flagProvider: featureFlags,
        onClose: { navigationController.popViewController() }
    )
}

Full-Screen Presentation

.fullScreenCover(isPresented: $showFullScreen) {
    ConversationUIContainer(
        viewModel: conversationViewModel,
        flagProvider: featureFlags,
        onClose: { showFullScreen = false }
    )
}