LiveViewNative
The LiveViewNative Swift package lets you use Phoenix LiveView to build native iOS apps with SwiftUI.
Installation
- In Xcode, select File β Add Packages...
- Enter the package URL
https://github.com/liveview-native/liveview-client-swiftui
- Select Add Package
Usage
Create a LiveView
to connect to a Phoenix server running on http://localhost:4000
.
import SwiftUI
import LiveViewNative
struct ContentView: View {
var body: some View {
LiveView(.localhost)
}
}
Now when you start up your app, the LiveView will automatically connect and serve your native app.
Elixir Library
This library is experimental in the current implementation. As we continue to develop the LiveView Native ecosystem this library will likely see rapid evolution and changes.
Installation
If available in Hex, the package can be installed
by adding live_view_native_swift_ui
to your list of dependencies in mix.exs
:
def deps do
[
{:live_view_native_swift_ui, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/live_view_native_swift_ui.
Resources
- Browse the documentation to read about the API.
- Follow the tutorial to get a step-by-step walkthrough of building an app with LiveView Native.
- Check out the ElixirConf '22 chat app for an example of a complete app.