generated from element-hq/.github
-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathAdvancedSettingsScreenModels.swift
41 lines (32 loc) · 1.17 KB
/
AdvancedSettingsScreenModels.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Copyright 2022-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
//
import Foundation
struct AdvancedSettingsScreenViewState: BindableState {
var bindings: AdvancedSettingsScreenViewStateBindings
}
// periphery:ignore - subscript are seen as false positives
@dynamicMemberLookup
struct AdvancedSettingsScreenViewStateBindings {
private let advancedSettings: AdvancedSettingsProtocol
init(advancedSettings: AdvancedSettingsProtocol) {
self.advancedSettings = advancedSettings
}
subscript<Setting>(dynamicMember keyPath: ReferenceWritableKeyPath<AdvancedSettingsProtocol, Setting>) -> Setting {
get { advancedSettings[keyPath: keyPath] }
set { advancedSettings[keyPath: keyPath] = newValue }
}
}
enum AdvancedSettingsScreenViewAction {
case optimizeMediaUploadsChanged
}
protocol AdvancedSettingsProtocol: AnyObject {
var viewSourceEnabled: Bool { get set }
var appAppearance: AppAppearance { get set }
var sharePresence: Bool { get set }
var optimizeMediaUploads: Bool { get set }
}
extension AppSettings: AdvancedSettingsProtocol { }