floriangbh / OpenSourceController

The simplest way to display the librarie's licences used in your application.
MIT License
52 stars 5 forks source link

SwiftUI support #5

Closed doronkatz closed 4 years ago

doronkatz commented 4 years ago

This is to support SwiftUI, by referencing a struct wrapped ViewController. On client-side, you still need to implement UIViewControllerRepresentable as denoted in https://www.hackingwithswift.com/books/ios-swiftui/wrapping-a-uiviewcontroller-in-a-swiftui-view.

doronkatz commented 4 years ago

We may need to parametize the struct wrapper. Would be good to workout best way to have an extension for that. It’s how I’m using it right now in my app but maybe best to just leave it on client side.

Anyhow I have it forked for now maybe circle back and find a better way later on

This email and any attachments are confidential and may be subject to copyright, legal or some other professional privilege. They are intended solely for the attention and use of the named addressee(s). They may only be copied, distributed or disclosed with the consent of the copyright owner. If you have received this email by mistake or by breach of the confidentiality clause, please notify the sender immediately by return email and delete or destroy all copies of the email. Any confidentiality, privilege or copyright is not waived or lost because this email has been sent to you by mistake.

floriangbh commented 4 years ago

Ok thanks for the explanation !

I just tested it and I think the OpenSourceViewController+UISwift.swift isn't really useful in this repository. In addition to that the file isn't in the sources folder so it will not be include with SPM for exemple.

I will merge your PR, delete the OpenSourceViewController+UISwift.swift file and add SwiftUI's struct wrapper exemple in the documentation.

Thanks :)