ClashX.Meta/ClashX/Managers/ConfigManager.swift

45 lines
925 B
Swift
Raw Normal View History

2018-06-13 10:44:30 +08:00
//
// ConfigManager.swift
// ClashX
//
// Created by on 2018/6/12.
// Copyright © 2018 west2online. All rights reserved.
//
import Foundation
import Cocoa
class ConfigManager {
private static let instance = ConfigManager()
var _httpProxyPort = 0
var _socksProxyPort = 0
static var proxyPortAutoSet:Bool {
get{
return UserDefaults.standard.bool(forKey: "proxyPortAutoSet")
}
set {
UserDefaults.standard.set(newValue, forKey: "proxyPortAutoSet")
}
}
static var httpProxyPort:Int {
get{
return instance._httpProxyPort
}
set {
instance._httpProxyPort = newValue
}
}
static var socksProxyPort:Int {
get{
return instance._socksProxyPort
}
set {
instance._socksProxyPort = newValue
}
}
}