vtourraine / AcknowList

Acknowledgements screen displaying a list of licenses, for example from CocoaPods and Swift Package Manager dependencies.
MIT License
784 stars 59 forks source link

Custom Label Layout for SwiftUI #100

Closed officebluesource closed 1 year ago

officebluesource commented 2 years ago

This feature enables you to create a custom label for the List. If you want to style the label of the list entry you can design it by using the closure at the call. If you don't want to use a custom design, you can just omit the closure and the default implementation gets used.

Call with a custom label: AcknowListSwiftUIView(acknowledgements: acks, headerText: "TestHeader", footerText: "TestFooter") { elem in HStack { Spacer() Text(elem.title + "test") Spacer() } }

Call without a custom label (as it used to be): AcknowListSwiftUIView(acknowledgements: acks, headerText: "TestHeader", footerText: "TestFooter")

vtourraine commented 2 years ago

Thank you very much for the pull request!

I appreciate that customizability is important for this kind of library, but I’ve always tried to keep the implementation as simple as possible. I have a limited understanding of SwiftUI best-practices, but this looks like too much custom code for something relatively specific. Of course, you’re welcome to use this fork for your own needs, but I’m not sure how valuable it would be to merge this into the main repo.

I’m happy to keep this pull request open to continue the discussion, and I’d love to hear from other developers as well.