alexito4/EquallySpacedStack
Equally Spaced Stacks for SwiftUI
Status
This package is work in progress. I'm still trying to figure out the best way of doing custom layouts in SwiftUI.
If you want to follow the process you can read my blog or follow me on Twitter:
Usage
Just replace HStack or VStack with EquallySpacedHStack or EquallySpacedVStack:
EquallySpacedHStack {
Color.red.frame(width: 50, height: 50)
Color.blue.frame(width: 50, height: 50)
Color.green.frame(width: 50, height: 50)
}you can also use ForEach:
EquallySpacedHStack {
ForEach(1...4) { _ in
Color.red.frame(width: 50, height: 50)
}
}WIP
- [ ] Avoid issue when using more than the supported number of nested subviews.
- [ ] Support more nested subviews (max is now 4)
- [ ] Avoid using the type erased
AnyView
Contributions & support
This project is developed completely in the open, and your contributions are more than welcome.
This project does not come with GitHub Issues-based support, and users are instead encouraged to become active participants in its continued development — by fixing any bugs that they encounter, or improving the documentation wherever it’s found to be lacking.
If you wish to make a change, open a Pull Request — even if it just contains a draft of the changes you’re planning, or a test that reproduces an issue — and we can discuss it further from there.
Package Metadata
Repository: alexito4/EquallySpacedStack
Stars: 21
Forks: 3
Open issues: 1
Default branch: master
Primary language: swift
Topics: package, swift, swiftui
README: README.md