iOS simple controller works
This commit is contained in:
@@ -8,20 +8,18 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct UserKeys{
|
||||
static let host = "host"
|
||||
static let port = "port"
|
||||
}
|
||||
|
||||
final class ServerData: ObservableObject{
|
||||
|
||||
// TODO: Find a way to save/represent this stuff in iOS settings/preferences (user can access via settings app).
|
||||
// Then load the below values ar runtime, from settings.
|
||||
// Ideally want to be able to open this settings page from within the app as well.
|
||||
|
||||
|
||||
@Published var port: Int = 50051
|
||||
@Published var grpcPort: Int = 50050
|
||||
@Published var host: String = "10.0.0.53"
|
||||
@Published var host: String = UserDefaults.standard.string(forKey: UserKeys.host) ?? "10.0.0.53"
|
||||
@Published var grpcPort: Int = UserDefaults.standard.integer(forKey: UserKeys.port)
|
||||
|
||||
func load(){
|
||||
// Load the server values from settings, if they had been
|
||||
// previously saved.
|
||||
// Load the server values from settings, if they had been previously saved.
|
||||
}
|
||||
|
||||
func save(){
|
||||
|
||||
Reference in New Issue
Block a user