jessesquires / jessesquires/ReactiveCollectionsKit

Implement some kind of ViewBuilder (`ResultBuilder`) API?

Open
#93 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Swift
Stars
194
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Not sure how/if this would/could work, but providing some SwiftUI-ish style API would be nice.

It would be cool to be able to write something like:

```swift
Collection {
Section {
Cell { /* ... */ }
Cell { /* ... */ }
Cell { /* ... */ }
}

Section {
Cell { /* ... */ }
Cell { /* ... */ }
Cell { /* ... */ }
}
}
```

Aside from SwiftUI's [`ViewBuilder`](https://developer.apple.com/documentation/swiftui/viewbuilder), the classic example seems to be an HTML renderer:

- https://www.hackingwithswift.com/articles/266/build-your-next-website-in-swift

### Docs and Blogs

- https://developer.apple.com/videos/play/wwdc2021/10253/
- https://www.avanderlee.com/swift/result-builders/
- https://www.swiftbysundell.com/articles/deep-dive-into-swift-function-builders/
- https://www.hackingwithswift.com/swift/5.4/result-builders
- https://www.mobilesystemdesign.com/blog/declarative-api-design/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.