You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
771 B
34 lines
771 B
//
|
|
// Config.swift
|
|
// PadelClubData
|
|
//
|
|
// Created by Laurent Morvillier on 21/05/2025.
|
|
//
|
|
|
|
@testable import PadelClubData
|
|
|
|
class Config {
|
|
|
|
var secure: Bool
|
|
var domain: String
|
|
|
|
init(secure: Bool, domain: String) {
|
|
self.secure = secure
|
|
self.domain = domain
|
|
}
|
|
|
|
static var server: Config {
|
|
|
|
let bundle = Bundle(for: self)
|
|
|
|
let secure = PListReader.readBool(plist: "config", key: "secure_server", bundle: bundle)
|
|
let domain = PListReader.readString(plist: "config", key: "server_domain", bundle: bundle)
|
|
|
|
if let secure, let domain {
|
|
return Config(secure: secure, domain: domain)
|
|
}
|
|
|
|
fatalError("no server configuration")
|
|
}
|
|
|
|
}
|
|
|