summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorAndrew Bulhak <andrew.bulhak@mullvad.net>2024-11-05 13:01:03 +0100
committerBug Magnet <marco.nikic@mullvad.net>2024-11-28 09:54:26 +0100
commita4a0a50edca0803d3a155562cce66b7066e5c237 (patch)
tree647a6a935ba700a5b34d8c860f7fa782842dd666 /ios
parentb1b697f93681329688d159798451d0b420ae5f3a (diff)
downloadmullvadvpn-a4a0a50edca0803d3a155562cce66b7066e5c237.tar.xz
mullvadvpn-a4a0a50edca0803d3a155562cce66b7066e5c237.zip
Implement SwiftUI UI for UDP TCP Obfuscation port selector view
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift13
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift12
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSourceDelegate.swift1
3 files changed, 26 insertions, 0 deletions
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
index 526fb1c16c..eee4103311 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
@@ -66,6 +66,19 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
cell.disclosureType = .chevron
cell.accessibilityIdentifier = item.accessibilityIdentifier
+ case .udpTcpObfuscationSettings:
+ guard let cell = cell as? SettingsCell else { return }
+
+ cell.titleLabel.text = NSLocalizedString(
+ "UDP_TCP_OBFUSCATION_CELL_LABEL",
+ tableName: "VPNSettings",
+ value: "UDP/TCP Obfuscation",
+ comment: ""
+ )
+
+ cell.disclosureType = .chevron
+ cell.accessibilityIdentifier = item.accessibilityIdentifier
+
case let .wireGuardPort(port):
guard let cell = cell as? SelectableSettingsCell else { return }
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
index f74717f1bc..d5f83c0ac0 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
@@ -22,6 +22,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case wireGuardCustomPort
case wireGuardObfuscation
case wireGuardObfuscationOption
+ case udpTcpObfuscationSettings
case wireGuardObfuscationPort
case quantumResistance
case multihop
@@ -40,6 +41,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return SelectableSettingsDetailsCell.self
case .wireGuardObfuscation:
return SelectableSettingsCell.self
+ case .udpTcpObfuscationSettings:
+ return SettingsCell.self
case .wireGuardObfuscationPort:
return SelectableSettingsCell.self
case .quantumResistance:
@@ -74,6 +77,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case ipOverrides
case wireGuardPort(_ port: UInt16?)
case wireGuardCustomPort
+ case udpTcpObfuscationSettings
case wireGuardObfuscationAutomatic
case wireGuardObfuscationUdpOverTcp
case wireGuardObfuscationShadowsocks
@@ -127,6 +131,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return .wireGuardPort
case .wireGuardCustomPort:
return .wireGuardCustomPort
+ case .udpTcpObfuscationSettings:
+ return .udpTcpObfuscationSettings
case .wireGuardObfuscationAutomatic:
return .wireGuardObfuscationAutomatic
case .wireGuardObfuscationUdpOverTcp:
@@ -158,6 +164,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return .wireGuardPort
case .wireGuardCustomPort:
return .wireGuardCustomPort
+ case .udpTcpObfuscationSettings:
+ return .udpTcpObfuscationSettings
case .wireGuardObfuscationAutomatic, .wireGuardObfuscationOff:
return .wireGuardObfuscation
case .wireGuardObfuscationUdpOverTcp, .wireGuardObfuscationShadowsocks:
@@ -311,6 +319,10 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case .wireGuardCustomPort:
getCustomPortCell()?.textField.becomeFirstResponder()
+ case .udpTcpObfuscationSettings:
+ tableView.deselectRow(at: indexPath, animated: false)
+ delegate?.showUDPTCPObfuscationSettings()
+
case .wireGuardObfuscationAutomatic:
selectObfuscationState(.automatic)
delegate?.didUpdateTunnelSettings(TunnelSettingsUpdate.obfuscation(obfuscationSettings))
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSourceDelegate.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSourceDelegate.swift
index 98695d1f7f..f86dbbeebb 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSourceDelegate.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSourceDelegate.swift
@@ -20,6 +20,7 @@ protocol VPNSettingsDataSourceDelegate: AnyObject {
func showDetails(for: VPNSettingsDetailsButtonItem)
func showDNSSettings()
func showIPOverrides()
+ func showUDPTCPObfuscationSettings()
func didSelectWireGuardPort(_ port: UInt16?)
func humanReadablePortRepresentation() -> String
}