Implement a WebView
Web views are used by many applications and are also tricky to do in a cross-platform way. This makes them a perfect candidate for being a first party offering of SwiftCrossUI! Due to being a bit of a "you either need it or you don't" feature and requires additional dependencies on Linux, we probably want to pop this behind a trait once we bump to a Swift version that supports them.
This issue requires:
- Designing a declarative API for displaying and controlling a web view, likely using bindings for things such as the current URL, and modifiers for controlling settings such as whether JS is enabled etc.
- Updating the
AppBackendprotocol with suitable webview-related methods that neatly abstract over all of the common functionality that we want to wrap - Updating the underlying backend implementations to implement these new protocol requirements
- Implementing a
WebViewstruct conforming toViewand using the underlying backend to implement the designed API
Underlying technologies:
- On Apple platforms we can wrap WKWebView
- On Linux we can use WebKitGTK
- On Windows we can use WebView2
If you're tackling this issue, I'd recommend settling on an API design before getting started on the implementation and commenting on this issue with some details so that I can give some feedback or guidance. Alternatively, join the SwiftCrossUI Discord server and we can discuss things there.