https://github.com/schwa/xform
Demo project showing SwiftUI's new "subViewsOf" APIs
https://github.com/schwa/xform
Last synced: 10 days ago
JSON representation
Demo project showing SwiftUI's new "subViewsOf" APIs
- Host: GitHub
- URL: https://github.com/schwa/xform
- Owner: schwa
- License: mit
- Created: 2024-06-12T15:17:52.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-12T15:23:59.000Z (11 months ago)
- Last Synced: 2025-05-01T19:22:32.928Z (16 days ago)
- Language: Swift
- Size: 1.75 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XForm
An alternative "Form" API for SwiftUI highlighting Swift's new 'ForEach(subviewsOf:)' and 'Group(subViewsOf:)' APIs
**further description forthcoming**
```swift
struct XForm : View where Content: View {
let content: Contentinit(@ViewBuilder content: () -> Content) {
self.content = content()
}var body: some View {
ScrollView(.vertical) {
VStack {
Group(subviewsOf: content) { subviews in
ForEach(subviews.dropLast()) { subview in
subview
Divider()
}
subviews.last
}
}
.padding([.leading, .trailing])
}
}
}
```## Screenshot
![alt text]()