summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift19
1 files changed, 13 insertions, 6 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
index 68c70b04cc..4f2f5ab62c 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
@@ -40,9 +40,13 @@ class LocationCell: UITableViewCell {
private let checkboxButton: UIButton = {
let button = UIButton()
- button.setImage(UIImage(systemName: "checkmark.square.fill"), for: .selected)
- button.setImage(UIImage(systemName: "square"), for: .normal)
- button.tintColor = .white
+ let checkboxView = CheckboxView()
+
+ checkboxView.isUserInteractionEnabled = false
+ button.addConstrainedSubviews([checkboxView]) {
+ checkboxView.pinEdgesToSuperviewMargins(PinnableEdges([.top(8), .bottom(8), .leading(16), .trailing(16)]))
+ }
+
return button
}()
@@ -310,10 +314,13 @@ extension LocationCell {
locationLabel.text = item.node.name
showsCollapseControl = !item.node.children.isEmpty
isExpanded = item.node.showsChildren
- checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton
- checkboxButton.isSelected = item.isSelected
- checkboxButton.tintColor = item.isSelected ? .successColor : .white
accessibilityValue = item.node.code
+ checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton
+
+ for view in checkboxButton.subviews where view is CheckboxView {
+ let checkboxView = view as? CheckboxView
+ checkboxView?.isChecked = item.isSelected
+ }
if item.node is CustomListLocationNode {
accessibilityIdentifier = .customListLocationCell