https://github.com/bermudalocket/gravitystack
A versatile stack view that pulls its contents in a given direction.
https://github.com/bermudalocket/gravitystack
swiftui
Last synced: about 1 month ago
JSON representation
A versatile stack view that pulls its contents in a given direction.
- Host: GitHub
- URL: https://github.com/bermudalocket/gravitystack
- Owner: bermudalocket
- License: mit
- Created: 2020-06-14T18:53:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T17:57:39.000Z (almost 6 years ago)
- Last Synced: 2025-03-22T15:16:39.273Z (about 1 year ago)
- Topics: swiftui
- Language: Swift
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GravityStack
A versatile stack view that pulls its contents in a given direction.
A basic use case:
```
HStack {
Text("Page Title")
.font(.largeTitle)
Spacer()
}
```
can be replaced with
```
GravityStack {
Text("Page Title")
.font(.largeTitle)
}
```
Gravity pulls in the `leading` direction by default.
A more robust initializer is:
```
GravityStack(.vertical, gravity: .trailing, gravityStrength: 0.75) {
MyContent()
}
```