Files
element-x-ios/ElementX/Sources/Screens/Settings/LocationSharingSettingsScreen/LocationSharingSettingsScreenModels.swift
Doug fc75f90ef5 Remove the dynamic member lookup from UserSettings in favour of nested access. (#6294)
* Remove the dynamic member lookup from UserSettings in favour of nested access.

* Remove forwarding methods from UserSettings.

* Update the Enterprise submodule.
2026-10-08 15:19:44 +01:00

42 lines
1.4 KiB
Swift

//
// Copyright 2026 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
import UIKit
struct LocationSharingSettingsScreenViewState: BindableState {
init(bindings: LocationSharingSettingsScreenViewStateBindings) {
self.bindings = bindings
let linkPlaceholder = "{link}"
var footerString = AttributedString(L10n.screenAdvancedSettingsLiveLocationSectionFooter(linkPlaceholder))
var linkString = AttributedString(L10n.screenAdvancedSettingsLiveLocationSectionFooterLink)
linkString.link = URL(string: UIApplication.openSettingsURLString)
linkString.bold()
footerString.replace(linkPlaceholder, with: linkString)
liveLocationUpdateFooterAttributedString = footerString
}
let liveLocationUpdateFooterAttributedString: AttributedString
var bindings: LocationSharingSettingsScreenViewStateBindings
}
struct LocationSharingSettingsScreenViewStateBindings {
private let userSettings: UserSettings
init(userSettings: UserSettings) {
self.userSettings = userSettings
}
var liveLocationMinimumDistanceUpdate: Int {
get { userSettings.app.liveLocationMinimumDistanceUpdate }
set { userSettings.app.liveLocationMinimumDistanceUpdate = newValue }
}
}
enum LocationSharingSettingsScreenViewAction { }