Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyome22/flexiblestack
This provides flexible stack layout in SwiftUI.
https://github.com/kyome22/flexiblestack
Last synced: 3 months ago
JSON representation
This provides flexible stack layout in SwiftUI.
- Host: GitHub
- URL: https://github.com/kyome22/flexiblestack
- Owner: Kyome22
- License: mit
- Created: 2023-11-30T16:02:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-28T16:12:30.000Z (10 months ago)
- Last Synced: 2024-03-06T18:47:42.929Z (10 months ago)
- Language: Swift
- Homepage:
- Size: 4 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FlexibleStack
This provides flexible stack layout in SwiftUI.
Optimizes the arrangement of items according to the aspect ratio of the parent view.
Optimize the arrangement of items according to the number of them.
## Requirements
- Development with Xcode 15.2+
- Written in Swift 5.9
- swift-tools-version: 5.9
- Compatible with iOS 16.4+## Usage
```swift
struct ContentView: View {
let colors: [Color] = [.blue, .red, .green, .orange]var body: some View {
FlexibleVStack {
ForEach(colors.indices, id: \.self) { index in
Rectangle()
.foregroundStyle(colors[index])
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
.padding()
}
}
```