Edit in GitHubLog an issue

InboxState

An enum representing the current state of an InboxUI instance.

Enum Definition

Copied to your clipboard
public enum InboxState {
case loading
case loaded([ContentCardUI])
case error(Error)
}

Cases

CaseAssociated ValueDescription
loading
The inbox is fetching content. The default loading view (or custom loading view) is displayed.
loaded
[ContentCardUI]
Content has been fetched. The associated array contains the content cards to display. The array may be empty if the inbox has no content, in which case the empty state view is displayed.
error
Error
An error occurred while loading. The associated value is the Error that was encountered. See InboxError for inbox-specific error types.

Usage

InboxState is exposed as a @Published property on InboxUI. You can observe it directly if you need to drive custom UI outside of the built-in InboxUI.view.

Copied to your clipboard
import SwiftUI
import AEPMessaging
struct InboxPage: View {
@ObservedObject var inboxUI: InboxUI
var body: some View {
switch inboxUI.state {
case .loading:
ProgressView("Loading...")
case .loaded(let cards) where cards.isEmpty:
Text("No messages")
case .loaded(let cards):
ScrollView {
ForEach(cards) { card in
card.view
}
}
case .error(let error):
Text("Error: \(error.localizedDescription)")
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.