LiTranslate-iOS/LiTranslate/Application/ObservableObjects/InstanceURL.swift
Viktor 3474967700
release v1.2 (#5)
- Support for api's that use keys
- Removed idle instances.
---------
Co-authored-by: Viktor Kalyniuk <@>
Co-authored-by: Simon Rieger <simono41@brothertec.eu>
2023-08-23 13:06:15 +03:00

27 lines
661 B
Swift

//
// InstanceURL.swift
// LiTranslate
//
// Created by Viktor Kalyniuk on 22.08.2022.
//
import Foundation
import SwiftUI
class InstanceURL: ObservableObject {
@AppStorage(Keys.libreTranslateDefaultURL) var defaultURL: Links.LibreTranslateMirrors = Links.LibreTranslateMirrors.de
@AppStorage(Keys.libreTranslateSelfHostURL) var selfHostURL: String = ""
@AppStorage(Keys.libreTranslateSelfHostKey) var selfHostKey: String = ""
func getURL() -> String {
if selfHostURL.isEmpty {
return defaultURL.rawValue
}
return selfHostURL
}
func getKey() -> String {
return selfHostKey
}
}