2021-04-26 10:57:50 +02:00
|
|
|
//
|
|
|
|
// AppearancePreference.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by MainasuK Cirno on 2021-4-26.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
extension UserDefaults {
|
|
|
|
|
2022-04-14 15:15:21 +02:00
|
|
|
@objc public dynamic var customUserInterfaceStyle: UIUserInterfaceStyle {
|
2021-04-26 10:57:50 +02:00
|
|
|
get {
|
|
|
|
register(defaults: [#function: UIUserInterfaceStyle.unspecified.rawValue])
|
|
|
|
return UIUserInterfaceStyle(rawValue: integer(forKey: #function)) ?? .unspecified
|
|
|
|
}
|
2021-04-27 10:26:59 +02:00
|
|
|
set { self[#function] = newValue.rawValue }
|
2021-04-26 10:57:50 +02:00
|
|
|
}
|
|
|
|
|
2022-04-14 15:15:21 +02:00
|
|
|
@objc public dynamic var preferredStaticAvatar: Bool {
|
2021-07-07 08:55:41 +02:00
|
|
|
get {
|
2021-07-19 11:12:45 +02:00
|
|
|
// default false
|
|
|
|
// without set register to profile timeline performance
|
2021-07-07 08:55:41 +02:00
|
|
|
return bool(forKey: #function)
|
|
|
|
}
|
|
|
|
set { self[#function] = newValue }
|
|
|
|
}
|
|
|
|
|
2022-04-14 15:15:21 +02:00
|
|
|
@objc public dynamic var preferredStaticEmoji: Bool {
|
2021-07-23 13:33:05 +02:00
|
|
|
get {
|
|
|
|
// default false
|
|
|
|
// without set register to profile timeline performance
|
|
|
|
return bool(forKey: #function)
|
|
|
|
}
|
|
|
|
set { self[#function] = newValue }
|
|
|
|
}
|
|
|
|
|
2021-04-26 10:57:50 +02:00
|
|
|
}
|