SRStackHelper
SRStackHelper is a Swift class designed to facilitate the creation of complex UIStackViews, particularly for use in bottom sheets or similar layout scenarios. It allows you to build a stack view by adding various UI elements, such as labels, buttons, and image views, in a structured and customizable way.
Install / Use
/learn @siamakrostami/SRStackHelperREADME
SRStackHelper
SRStackHelper is a Swift class designed to facilitate the creation of complex UIStackViews, particularly for use in bottom sheets or similar layout scenarios. It allows you to build a stack view by adding various UI elements, such as labels, buttons, and image views, in a structured and customizable way.
Features
- Dynamic Stacks: Easily create dynamic stacks with text labels, buttons, and image views.
- Internal Stacks: Configure internal stacks within the main stack to organize content efficiently.
- Customization: Customize stack alignment, distribution, and spacing to achieve the desired layout.
- ResultBuilder Integration: Utilizes Swift's result builder feature for a clean and expressive syntax when building stacks.
Usage
// Create an instance of SRStackHelper
let SRStackHelper = SRStackHelper()
// Add individual items to the stack
SRStackHelper.createStack {
StackItems.text(label: observableLabel, properties: labelProperties)
StackItems.button(button: stackButton)
}
// Or create more complex stacks with internal stacks
SRStackHelper.createStack {
StackItems.text(label: observableLabel, properties: labelProperties)
StackItems.button(button: stackButton)
StackItems.imageView(frame: CGRect(x: 0, y: 0, width: 100, height: 100), image: UIImage(named: "example"))
}
// Build the final UIStackView
let stackView = SRStackHelper.build()
// Customize, hide, or show the stack as needed
SRStackHelper.hideStack()
SRStackHelper.showStack()
// Destroy the stack as needed
SRStackHelper.avadaKedavra()
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
2.1kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
openpencil
2.1kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
HappyColorBlend
HappyColorBlendVibe Project Guidelines Project Overview HappyColorBlendVibe is a Figma plugin for color palette generation with advanced tint/shade blending capabilities. It allows designers to
