openalloc / SwiftTabler

A multi-platform SwiftUI component for tabular data
Apache License 2.0
133 stars 13 forks source link

Feature Request : Add an optional footer. #43

Closed jjamminjim closed 2 years ago

jjamminjim commented 2 years ago

Would it possible to add an optional footer to the table.

reedes commented 2 years ago

It should be feasible to support an optional Footer using the same approach as headers are supported.

However, there's an init proliferation problem. The current combination of optional Header, Overlay, and Background require 2^3 (or 8) different inits for each table variation. Yet another optional Footer view will require 2^4 (or 16) inits for each.

Ideally there's a better way to address this problem than manually coding new inits. Code generation (using Sourcery, eg) might be the best option, unless there's a SwiftUI init trick I'm missing.

Pull requests accepted from whoever wishes to tackle this. 😀