summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@mullvad.net>2024-10-22 14:17:29 +0200
committerEmīls <emils@mullvad.net>2024-10-23 12:13:23 +0200
commit22f756836c9d59bc8f09935aa6adece8092148c5 (patch)
tree98c26c95eb91b7628c0254ca2006d626a384a845
parent53778b58d8ada77a992097df9a99ef00cd06183d (diff)
downloadmullvadvpn-22f756836c9d59bc8f09935aa6adece8092148c5.tar.xz
mullvadvpn-22f756836c9d59bc8f09935aa6adece8092148c5.zip
Remove explanatory text for Direct only in settings
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift56
1 files changed, 2 insertions, 54 deletions
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
index 3006be583b..be44c8e3cb 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
@@ -44,20 +44,6 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
case main
case version
case problemReport
-
- var sectionFooter: String? {
- switch self {
- case .daita:
- NSLocalizedString(
- "SETTINGS_DAITA_SECTION_FOOTER",
- tableName: "Settings",
- value: "Makes it possible to use DAITA with any server and is automatically enabled.",
- comment: ""
- )
- default:
- nil
- }
- }
}
enum Item: String {
@@ -116,6 +102,7 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
settingsCellFactory.makeCell(for: itemIdentifier, indexPath: indexPath)
}
+ tableView.sectionFooterHeight = 0
tableView.delegate = self
settingsCellFactory.delegate = self
@@ -150,44 +137,6 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
)
}
- func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
- let sectionIdentifier = snapshot().sectionIdentifiers[section]
-
- return switch sectionIdentifier {
- case .main:
- interactor.deviceState.isLoggedIn ? 0 : UITableView.automaticDimension
- case .daita, .version, .problemReport:
- UITableView.automaticDimension
- }
- }
-
- func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
- let sectionIdentifier = snapshot().sectionIdentifiers[section]
- guard let sectionFooterText = sectionIdentifier.sectionFooter else { return nil }
-
- guard let headerView = tableView
- .dequeueReusableView(withIdentifier: HeaderFooterReuseIdentifier.primary)
- else { return nil }
-
- var contentConfiguration = UIListContentConfiguration.mullvadGroupedFooter(tableStyle: .plain)
- contentConfiguration.text = sectionFooterText
-
- headerView.contentConfiguration = contentConfiguration
-
- return headerView
- }
-
- func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
- let sectionIdentifier = snapshot().sectionIdentifiers[section]
-
- return switch sectionIdentifier {
- case .daita:
- UITableView.automaticDimension
- case .main, .version, .problemReport:
- 0
- }
- }
-
// MARK: - Private
private func registerClasses() {
@@ -211,13 +160,12 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
if interactor.deviceState.isLoggedIn {
snapshot.appendSections([.daita])
+ snapshot.appendItems([.daita, .daitaDirectOnly], toSection: .daita)
}
snapshot.appendSections([.main])
if interactor.deviceState.isLoggedIn {
- snapshot.appendItems([.daita], toSection: .daita)
- snapshot.appendItems([.daitaDirectOnly], toSection: .daita)
snapshot.appendItems([.vpnSettings], toSection: .main)
}