Issue #3: Added Settings class to store selected BlocklistOption. Update system DoH settings, when user selects another blocklist.

This commit is contained in:
Benjamin Erhart 2026-04-15 13:40:29 +02:00
parent 807176f0b5
commit 6cbad66a87
2 changed files with 39 additions and 10 deletions

24
dns/Settings.swift Normal file
View file

@ -0,0 +1,24 @@
//
// Settings.swift
// dns
//
// Created by Benjamin Erhart on 15.04.26.
//
import Foundation
class Settings {
private static let blocklistKey = "blocklist"
private static let defaults = UserDefaults.standard
class var blocklist: BlocklistOption {
get {
BlocklistOption(rawValue: defaults.string(forKey: blocklistKey) ?? BlocklistOption.secure.rawValue) ?? .secure
}
set {
defaults.set(newValue.rawValue, forKey: blocklistKey)
}
}
}