Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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()
}
}
```