XcodeGen project, SwiftUI iOS 17 target dev.shane.voice, SPM livekit-client-swift 2.16.0, mic usage + ATS LAN exception in Info.plist, placeholder conversation screen and Settings with server URL field.
29 lines
806 B
Swift
29 lines
806 B
Swift
import SwiftUI
|
|
|
|
struct SettingsView: View {
|
|
@ObservedObject var settings: SettingsStore
|
|
@State private var urlText: String = ""
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section("Server") {
|
|
TextField("https://192.168.86.2:9178", text: $urlText)
|
|
.keyboardType(.URL)
|
|
.autocorrectionDisabled()
|
|
.onAppear { urlText = settings.serverURL }
|
|
.onChange(of: urlText) { _, newValue in
|
|
settings.serverURL = newValue
|
|
}
|
|
}
|
|
Section("Interaction") {
|
|
Toggle("Text mode", isOn: $settings.textMode)
|
|
}
|
|
}
|
|
.navigationTitle("Settings")
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
SettingsView(settings: SettingsStore())
|
|
}
|