diff options
| author | Steffen <steffen.ernst@mullvad.net> | 2025-09-25 15:10:22 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-09-30 11:11:30 +0200 |
| commit | 3d21f798cbdf88bb579129df585c8c5c5144b4ea (patch) | |
| tree | 18819ab717a1feccf99e067cc2f28b5532d255b5 /ios | |
| parent | 977e616b096c1838060d80b11baf7d0800402621 (diff) | |
| download | mullvadvpn-3d21f798cbdf88bb579129df585c8c5c5144b4ea.tar.xz mullvadvpn-3d21f798cbdf88bb579129df585c8c5c5144b4ea.zip | |
Apply more swift format changes
Diffstat (limited to 'ios')
5 files changed, 141 insertions, 118 deletions
diff --git a/ios/MullvadVPN/Coordinators/Settings/DAITA/SettingsDAITAView.swift b/ios/MullvadVPN/Coordinators/Settings/DAITA/SettingsDAITAView.swift index 2e5224a556..4eea9be2ef 100644 --- a/ios/MullvadVPN/Coordinators/Settings/DAITA/SettingsDAITAView.swift +++ b/ios/MullvadVPN/Coordinators/Settings/DAITA/SettingsDAITAView.swift @@ -17,12 +17,13 @@ struct SettingsDAITAView<ViewModel>: View where ViewModel: TunnelSettingsObserva VStack(alignment: .leading, spacing: 8) { if isAutomaticRoutingActive { DAITAMultihopNotice() - .padding(EdgeInsets( - top: -8, - leading: UIMetrics.contentInsets.toEdgeInsets.leading, - bottom: 8, - trailing: UIMetrics.contentInsets.toEdgeInsets.trailing - )) + .padding( + EdgeInsets( + top: -8, + leading: UIMetrics.contentInsets.toEdgeInsets.leading, + bottom: 8, + trailing: UIMetrics.contentInsets.toEdgeInsets.trailing + )) } SettingsInfoView(viewModel: dataViewModel) @@ -46,11 +47,11 @@ struct SettingsDAITAView<ViewModel>: View where ViewModel: TunnelSettingsObserva SettingsRowViewFooter( text: String( format: - NSLocalizedString( - "By enabling “%@” you will have to manually select a server that is %@-enabled. " + - "%@ won't automatically be used to enable DAITA with any server.", - comment: "" - ), + NSLocalizedString( + "By enabling “%@” you will have to manually select a server that is %@-enabled. " + + "%@ won't automatically be used to enable DAITA with any server.", + comment: "" + ), NSLocalizedString("Direct only", comment: ""), NSLocalizedString("DAITA", comment: ""), NSLocalizedString("Multihop", comment: "") @@ -73,7 +74,8 @@ extension SettingsDAITAView { Binding<Bool>( get: { tunnelViewModel.value.daitaState.isEnabled - }, set: { enabled in + }, + set: { enabled in var settings = tunnelViewModel.value settings.daitaState.isEnabled = enabled @@ -86,7 +88,8 @@ extension SettingsDAITAView { Binding<Bool>( get: { tunnelViewModel.value.directOnlyState.isEnabled - }, set: { enabled in + }, + set: { enabled in var settings = tunnelViewModel.value settings.directOnlyState.isEnabled = enabled @@ -110,8 +113,8 @@ extension SettingsDAITAView { SettingsInfoViewModelPage( body: [ NSLocalizedString( - "**Attention: This increases network traffic and will also negatively affect " + - "speed, latency, and battery usage. Use with caution on limited plans.**", + "**Attention: This increases network traffic and will also negatively affect " + + "speed, latency, and battery usage. Use with caution on limited plans.**", comment: "" ), String( @@ -123,9 +126,9 @@ extension SettingsDAITAView { daitafullTitle ), NSLocalizedString( - "By using sophisticated AI it’s possible to analyze " + - "the traffic of data packets going in and out of your " + - "device (even if the traffic is encrypted).", + "By using sophisticated AI it’s possible to analyze " + + "the traffic of data packets going in and out of your " + + "device (even if the traffic is encrypted).", comment: "" ), ].joinedParagraphs(), @@ -133,22 +136,25 @@ extension SettingsDAITAView { ), SettingsInfoViewModelPage( body: [ - String(format: NSLocalizedString( - "If an observer monitors these data packets, %@ makes it " + - "significantly harder for them to identify which websites " + - "you are visiting or with whom you are communicating.", - comment: "" - ), daitaTitle), - String(format: NSLocalizedString( - "%@ does this by carefully adding network noise and making " + - "all network packets the same size.", - comment: "" - ), daitaTitle), - String(format: NSLocalizedString( - "Not all our servers are %@-enabled. Therefore, we use multihop " + - "automatically to enable %@ with any server.", - comment: "" - ), daitaTitle, daitaTitle), + String( + format: NSLocalizedString( + "If an observer monitors these data packets, %@ makes it " + + "significantly harder for them to identify which websites " + + "you are visiting or with whom you are communicating.", + comment: "" + ), daitaTitle), + String( + format: NSLocalizedString( + "%@ does this by carefully adding network noise and making " + + "all network packets the same size.", + comment: "" + ), daitaTitle), + String( + format: NSLocalizedString( + "Not all our servers are %@-enabled. Therefore, we use multihop " + + "automatically to enable %@ with any server.", + comment: "" + ), daitaTitle, daitaTitle), ].joinedParagraphs(), image: .daitaOnIllustration ), diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift index 65ddc64831..1267dc58bf 100644 --- a/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift +++ b/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift @@ -108,29 +108,33 @@ class SetupAccountCompletedContentView: UIView { buttonsStackView.addArrangedSubview(startButton) scrollView.addConstrainedSubviews([textsStackView]) { - textsStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(0), - .trailing(0), - ])) + textsStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(0), + .trailing(0), + ])) - textsStackView.pinEdgesToSuperview(PinnableEdges([ - .top(0), - .bottom(0), - ])) + textsStackView.pinEdgesToSuperview( + PinnableEdges([ + .top(0), + .bottom(0), + ])) } addConstrainedSubviews([scrollView, buttonsStackView]) { - scrollView.pinEdgesToSuperviewMargins(PinnableEdges([ - .top(UIMetrics.contentLayoutMargins.top), - .leading(0), - .trailing(0), - ])) + scrollView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .top(UIMetrics.contentLayoutMargins.top), + .leading(0), + .trailing(0), + ])) - buttonsStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(UIMetrics.padding8), - .trailing(UIMetrics.padding8), - .bottom(UIMetrics.contentLayoutMargins.bottom), - ])) + buttonsStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(UIMetrics.padding8), + .trailing(UIMetrics.padding8), + .bottom(UIMetrics.contentLayoutMargins.bottom), + ])) buttonsStackView.topAnchor.constraint( equalTo: scrollView.bottomAnchor, diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift index 748e896552..bd38ab1bc5 100644 --- a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift +++ b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift @@ -210,29 +210,33 @@ final class WelcomeContentView: UIView, Sendable { private func addConstraints() { scrollView.addConstrainedSubviews([textsStackView]) { - textsStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(0), - .trailing(0), - ])) + textsStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(0), + .trailing(0), + ])) - textsStackView.pinEdgesToSuperview(PinnableEdges([ - .top(0), - .bottom(0), - ])) + textsStackView.pinEdgesToSuperview( + PinnableEdges([ + .top(0), + .bottom(0), + ])) } addConstrainedSubviews([scrollView, buttonsStackView]) { - scrollView.pinEdgesToSuperviewMargins(PinnableEdges([ - .top(UIMetrics.contentLayoutMargins.top), - .leading(0), - .trailing(0), - ])) + scrollView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .top(UIMetrics.contentLayoutMargins.top), + .leading(0), + .trailing(0), + ])) - buttonsStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(UIMetrics.padding8), - .trailing(UIMetrics.padding8), - .bottom(UIMetrics.contentLayoutMargins.bottom), - ])) + buttonsStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(UIMetrics.padding8), + .trailing(UIMetrics.padding8), + .bottom(UIMetrics.contentLayoutMargins.bottom), + ])) buttonsStackView.topAnchor.constraint( equalTo: scrollView.bottomAnchor, diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementView.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementView.swift index 98b7852bbb..76a2fe4a2c 100644 --- a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementView.swift +++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementView.swift @@ -32,9 +32,11 @@ struct DeviceManagementView: View { } return switch self { case .tooManyDevices: - [LocalizedStringKey( - "Are you sure you want to log \(attributedDeviceName) out?" - )] + [ + LocalizedStringKey( + "Are you sure you want to log \(attributedDeviceName) out?" + ) + ] case .deviceManagement: [ LocalizedStringKey("Remove \(attributedDeviceName)?"), @@ -128,7 +130,8 @@ struct DeviceManagementView: View { self.loggedInDevices?.removeAll(where: { $0.id == device.id }) case let .failure(error): self.loggedInDevices = loggedInDevices.map { - $0.id == device + $0.id + == device .id ? $0.setIsBeingRemoved(false) : $0 } onError("Failed to log out device", error) @@ -142,34 +145,36 @@ struct DeviceManagementView: View { ), dismissButtonTitle: "Cancel" ) - }, header: { - AnyView(VStack(alignment: .leading, spacing: 8) { - if case .tooManyDevices = style { - if canLoginNewDevice { - HStack { - Spacer() - Image.mullvadIconSuccess - Spacer() - } - Text("Super!") - .font(.mullvadBig) - .foregroundStyle(Color.mullvadTextPrimary) - } else { - HStack { - Spacer() - Image.mullvadIconFail - Spacer() + }, + header: { + AnyView( + VStack(alignment: .leading, spacing: 8) { + if case .tooManyDevices = style { + if canLoginNewDevice { + HStack { + Spacer() + Image.mullvadIconSuccess + Spacer() + } + Text("Super!") + .font(.mullvadBig) + .foregroundStyle(Color.mullvadTextPrimary) + } else { + HStack { + Spacer() + Image.mullvadIconFail + Spacer() + } + Text("Too many devices") + .font(.mullvadBig) + .foregroundStyle(Color.mullvadTextPrimary) } - Text("Too many devices") - .font(.mullvadBig) - .foregroundStyle(Color.mullvadTextPrimary) } - } - Text(bodyText) - .foregroundColor(.mullvadTextPrimary) - .opacity(0.6) - .font(.mullvadTinySemiBold) - }) + Text(bodyText) + .foregroundColor(.mullvadTextPrimary) + .opacity(0.6) + .font(.mullvadTinySemiBold) + }) } ) Spacer() diff --git a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift index b23784d4f6..d0e32442ba 100644 --- a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift +++ b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift @@ -106,29 +106,33 @@ class OutOfTimeContentView: UIView { func setUpSubviews() { scrollView.addConstrainedSubviews([topStackView]) { - topStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(0), - .trailing(0), - ])) + topStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(0), + .trailing(0), + ])) - topStackView.pinEdgesToSuperview(PinnableEdges([ - .top(0), - .bottom(0), - ])) + topStackView.pinEdgesToSuperview( + PinnableEdges([ + .top(0), + .bottom(0), + ])) } addConstrainedSubviews([scrollView, bottomStackView]) { - scrollView.pinEdgesToSuperviewMargins(PinnableEdges([ - .top(UIMetrics.contentLayoutMargins.top), - .leading(0), - .trailing(0), - ])) + scrollView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .top(UIMetrics.contentLayoutMargins.top), + .leading(0), + .trailing(0), + ])) - bottomStackView.pinEdgesToSuperviewMargins(PinnableEdges([ - .leading(UIMetrics.padding8), - .trailing(UIMetrics.padding8), - .bottom(UIMetrics.contentLayoutMargins.bottom), - ])) + bottomStackView.pinEdgesToSuperviewMargins( + PinnableEdges([ + .leading(UIMetrics.padding8), + .trailing(UIMetrics.padding8), + .bottom(UIMetrics.contentLayoutMargins.bottom), + ])) bottomStackView.topAnchor.constraint( equalTo: scrollView.bottomAnchor, |
