-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftUI #80
Comments
Would love to see a SwiftUI interface. I'm currently using version 2.0 in a SwiftUI The creation is pretty straight forward. However, it requires to set a My example: struct AcknowListView: View {
var plistName: String
var body: some View {
AcknowListViewControllerViewWrapper(plistName: plistName)
.navigationBarTitle("Acknowledgements")
.edgesIgnoringSafeArea(.all)
}
}
private struct AcknowListViewControllerViewWrapper: UIViewControllerRepresentable {
/// The name of the plist file without its extension.
public let plistName: String
/// The list style for the internal table view.
public let listStyle: UITableView.Style = .insetGrouped
func makeUIViewController(context: UIViewControllerRepresentableContext<AcknowListViewControllerViewWrapper>) -> AcknowListViewController {
var viewController: AcknowListViewController
if let plistPath = Bundle.main.path(forResource: plistName, ofType: "plist") {
viewController = AcknowListViewController(plistPath: plistPath, style: listStyle)
} else {
viewController = AcknowListViewController(acknowledgements: [], style: listStyle)
}
return viewController
}
func updateUIViewController(_ uiViewController: AcknowListViewController, context: UIViewControllerRepresentableContext<AcknowListViewControllerViewWrapper>) {
}
} |
That’s very interesting, thank you for sharing that piece of code! I imagine offering a “true” SwiftUI implementation of the same UI would have its benefits, but it’s great to know it already works with |
You can check out the swiftui branch for a work-in-progress SwiftUI implementation. |
How should we update this library to offer a SwiftUI interface?
Any ideas and suggestions are welcome!
The text was updated successfully, but these errors were encountered: