InfoView
InfoView
is a multifunctional view for displaying Information or Splash screen.
The UI elements can be displayed or hidden depending on functionality.
The text properties must be set before displaying the view.
Initialization Parameters
- Required:
- title: The primary heading text (AttributedString or ViewBuilder)
- Optional:
- descriptionText: Supplemental information text
- action: Primary action control
- secondaryAction: Secondary action control
- loadingIndicator: Loading state visualization
Usage
AttributedString Shortcut (Quick Setup)
InfoView(
title: AttributedString("Title"),
descriptionText: AttributedString("Description Text"),
action: FioriButton(title: "Update Now") {
startUpdate()
},
secondaryAction: FioriButton(title: "Remind Later") {
scheduleReminder()
}
)
ViewBuilder Approach (Fully Customizable)
// Custom loading indicator with red circular style
let loadingIndicator = LoadingIndicator(
title: { Text("") },
progress: {
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: .red))
},
isPresented: .constant(true)
)
InfoView(
title: {
HStack(spacing: 8) {
Image(systemName: "exclamationmark.triangle.fill")
.foregroundColor(.yellow)
Text("Title")
.font(.headline)
}
},
descriptionText: {
Text(AttributedString(self.model.descriptionText ?? "")) // Dynamic title from model
.foregroundColor(.blue) // Custom text color
},
action: {
Toggle("Trust Device", isOn: $trustDevice)
.toggleStyle(.switch)
},
secondaryAction: {
Button("Start Tutorial") {
print("InfoView secondary button clicked")
}
},
loadingIndicator: { loadingIndicator }
)
-
Undocumented
Declaration
Swift
public init(@ViewBuilder title: () -> any View, @ViewBuilder descriptionText: () -> any View = { EmptyView() }, @ViewBuilder action: () -> any View = { EmptyView() }, @ViewBuilder secondaryAction: () -> any View = { EmptyView() }, @ViewBuilder loadingIndicator: () -> any View = { EmptyView() }, componentIdentifier: String? = InfoView.identifier)
-
Undocumented
Declaration
Swift
static let identifier: String
-
Undocumented
Declaration
Swift
init(title: AttributedString, descriptionText: AttributedString? = nil, action: FioriButton? = nil, secondaryAction: FioriButton? = nil, loadingIndicator: LoadingIndicator? = nil)
-
Undocumented
Declaration
Swift
init(_ configuration: InfoViewConfiguration)
-
Declaration
Swift
@MainActor public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }