-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathButtonCellContentConfiguration.swift
45 lines (35 loc) · 1.18 KB
/
ButtonCellContentConfiguration.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
42
43
44
45
//
// ButtonCellConfiguration.swift
// MullvadVPN
//
// Created by pronebird on 17/11/2023.
// Copyright © 2025 Mullvad VPN AB. All rights reserved.
//
import UIKit
/// The content configuration for cells that contain the full-width button.
struct ButtonCellContentConfiguration: UIContentConfiguration, Equatable {
/// Button label.
var text: String?
/// Button style.
var style: AppButton.Style = .default
/// Indicates whether button is enabled.
var isEnabled = true
/// Primary action for button.
var primaryAction: UIAction?
/// The button content edge insets.
var directionalContentEdgeInsets: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.insetLayoutMargins
// Accessibility identifier.
var accessibilityIdentifier: AccessibilityIdentifier?
func makeContentView() -> UIView & UIContentView {
return ButtonCellContentView(configuration: self)
}
func updated(for state: UIConfigurationState) -> Self {
return self
}
}
extension ButtonCellContentConfiguration {
struct TextProperties: Equatable {
var font = UIFont.systemFont(ofSize: 17)
var color = UIColor.Cell.titleTextColor
}
}