AEPStack
The AEPStack class is a fundamental layout container used to arrange multiple UI elements horizontally or vertically.
AEPStack conforms to ObservableObject, allowing it to be used reactively in SwiftUI views.
Public Properties
Property
Type
Description
Default Value
spacing
CGFloat
The spacing between child views in the stack.
8
modifier
AEPViewModifier
A custom view modifier for additional styling.
N/A
data-variant=info
data-slots=text
All properties are marked with @Published. Any changes will trigger updates to your UI.
AEPHStack
The AEPHStack class extends AEPStack and arranges its child views horizontally. It provides additional customization for aligning child views vertically.
AEPHStack Public Properties
Property
Type
Description
Default Value
AEPVStack
The AEPVStack class extends AEPStack and arranges its child views vertically. It provides additional customization for aligning child views horizontally.
AEPVStack Public Properties
Property
Type
Description
Default Value
Customization
Below is an example of how to customize the AEPHStack and AEPVStack properties when working with a SmallImageTemplate:
data-slots=heading, code
data-repeat=1
Swift
class MyCustomizer : ContentCardCustomizing {
func customize(template: SmallImageTemplate) {
// customize stack properties
template.rootHStack.spacing = 10
template.textVStack.alignment = .leading
template.textVStack.spacing = 20
// Customize the button stack
template.buttonHStack.modifier = AEPViewModifier(ButtonHStackModifier())
}
struct ButtonStackModifier: ViewModifier {
func body(content: Content) -> some View {
content
.frame(maxWidth: .infinity, alignment: .trailing)
}
}
}