Edit in GitHubLog an issue

AEPDismissButton

The AEPDismissButton class is a fundamental UI component used to create a dismiss button for content cards.

Customization of the dismiss button's properties can be achieved with a custom view modifier.

AEPDismissButton conforms to ObservableObject, allowing it to be used reactively in SwiftUI views.

Public Properties

PropertyTypeDescription
image
The image model representing the dismiss button's image.
alignment
The alignment of the dismiss button within the content card.
modifier
AEPViewModifier
A custom view modifier that can be applied to the dismiss button view for additional styling.

Customization

You can customize the AEPDismissButton properties when working with a template that includes a dismiss button. Here's an example:

Copied to your clipboard
class MyCustomizer: ContentCardCustomizing {
func customize(template: SmallImageTemplate) {
// Customize the dismiss button
template.dismissButton?.image.icon = "xmark.diamond" // SF Symbol name
template.dismissButton?.image.iconColor = .primary
template.dismissButton?.image.iconFont = .system(size: 10)
template.dismissButton?.alignment = .topTrailing
template.dismissButton?.modifier = AEPViewModifier(MyDismissButtonModifier())
}
struct MyDismissButtonModifier: ViewModifier {
func body(content: Content) -> some View {
content
.padding()
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.