diff options
| author | Sajad Vishkai <sajaclvishkai@gmail.com> | 2022-09-29 14:03:59 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-09-29 15:16:48 +0200 |
| commit | 88fc18a39e960f1b0e16b3b4f2c0e7d76e7ebf01 (patch) | |
| tree | 3048b9120a2527f889339b53914d592a61060001 | |
| parent | 5209e5c1ede9d6b8992203ec222c4c33c2539d53 (diff) | |
| download | mullvadvpn-88fc18a39e960f1b0e16b3b4f2c0e7d76e7ebf01.tar.xz mullvadvpn-88fc18a39e960f1b0e16b3b4f2c0e7d76e7ebf01.zip | |
Reformat with swiftformat 0.50
| -rw-r--r-- | ios/MullvadVPN/AppDelegate.swift | 6 | ||||
| -rw-r--r-- | ios/MullvadVPN/AutomaticKeyboardResponder.swift | 4 | ||||
| -rw-r--r-- | ios/MullvadVPN/DataSourceSnapshot.swift | 12 | ||||
| -rw-r--r-- | ios/MullvadVPN/DeviceManagementContentView.swift | 3 | ||||
| -rw-r--r-- | ios/MullvadVPN/NotificationController.swift | 7 | ||||
| -rw-r--r-- | ios/MullvadVPN/SelectLocationViewController.swift | 4 | ||||
| -rw-r--r-- | ios/MullvadVPN/TunnelManager/PacketTunnelOptions.swift | 9 | ||||
| -rw-r--r-- | ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift | 9 | ||||
| -rw-r--r-- | ios/Operations/AlertPresenter.swift | 3 |
9 files changed, 33 insertions, 24 deletions
diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index e08d84f025..92c99794fa 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -104,8 +104,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { didDiscardSceneSessions sceneSessions: Set<UISceneSession> ) { // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + // If any sessions were discarded while the application was not running, + // this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to + // the discarded scenes, as they will not return. } // MARK: - Background tasks diff --git a/ios/MullvadVPN/AutomaticKeyboardResponder.swift b/ios/MullvadVPN/AutomaticKeyboardResponder.swift index 553b9d948a..d10216b352 100644 --- a/ios/MullvadVPN/AutomaticKeyboardResponder.swift +++ b/ios/MullvadVPN/AutomaticKeyboardResponder.swift @@ -141,8 +141,8 @@ class AutomaticKeyboardResponder { // Determine presentation style within the context let presentationStyle: UIModalPresentationStyle - // Use the presentation style of a presented controller when parent controller is being presented as a child of - // other modal controller. + // Use the presentation style of a presented controller, + // when parent controller is being presented as a child of other modal controller. if let presented = parent.presentingViewController?.presentedViewController { presentationStyle = presented.modalPresentationStyle } else { diff --git a/ios/MullvadVPN/DataSourceSnapshot.swift b/ios/MullvadVPN/DataSourceSnapshot.swift index 6e19708776..b68935000c 100644 --- a/ios/MullvadVPN/DataSourceSnapshot.swift +++ b/ios/MullvadVPN/DataSourceSnapshot.swift @@ -281,8 +281,8 @@ extension DataSourceSnapshot { return Self.changeSetToDifference(changes) } - /// Infer and discard unnecessary moves that occur due to items shifting back or forth based on insertions and - /// deletions of other items. + /// Infer and discard unnecessary moves that occur due to items shifting back or forth based on + /// insertions and deletions of other items. private static func inferMoves(changes: [Change]) -> [Change] { var newChanges = [Change]() @@ -299,8 +299,8 @@ extension DataSourceSnapshot { continue } - // Replay all changes to compute the item's index path, ignoring the changes associated with the current - // change. + // Replay all changes to compute the item's index path, ignoring the changes + // associated with the current change. let inferredIndexPath = sortedChangesWithoutMoves .reduce(into: sourceIndexPath) { inferredIndexPath, otherChange in switch otherChange { @@ -323,8 +323,8 @@ extension DataSourceSnapshot { } } - // Discard the change if the index path, produced after replaying other changes, matches the target index - // path. + // Discard the change if the index path, produced after replaying other changes, + // matches the target index path. if inferredIndexPath != targetIndexPath { newChanges.append(contentsOf: sourceChange.breakMoveOntoInsertionDeletion()) } diff --git a/ios/MullvadVPN/DeviceManagementContentView.swift b/ios/MullvadVPN/DeviceManagementContentView.swift index a510632bf4..141ec9e007 100644 --- a/ios/MullvadVPN/DeviceManagementContentView.swift +++ b/ios/MullvadVPN/DeviceManagementContentView.swift @@ -155,7 +155,8 @@ class DeviceManagementContentView: UIView { scrollContentView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor), scrollContentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor), - statusImageView.topAnchor.constraint(equalTo: scrollContentView.layoutMarginsGuide.topAnchor), + statusImageView.topAnchor + .constraint(equalTo: scrollContentView.layoutMarginsGuide.topAnchor), statusImageView.centerXAnchor.constraint(equalTo: scrollContentView.centerXAnchor), titleLabel.topAnchor.constraint(equalTo: statusImageView.bottomAnchor, constant: 22), diff --git a/ios/MullvadVPN/NotificationController.swift b/ios/MullvadVPN/NotificationController.swift index 9585c26ff9..8d07dfefb9 100644 --- a/ios/MullvadVPN/NotificationController.swift +++ b/ios/MullvadVPN/NotificationController.swift @@ -65,8 +65,8 @@ class NotificationController: UIViewController { showsBanner = show if show { - // Make sure to lay out the banner before animating its appearance to avoid undesired horizontal expansion - // animation. + // Make sure to lay out the banner before animating its appearance to + // avoid undesired horizontal expansion animation. view.layoutIfNeeded() bannerView.isHidden = false @@ -125,7 +125,8 @@ class NotificationController: UIViewController { animator.startAnimation() } - // Do not emit the .layoutChanged unless the banner is focused to avoid capturing the voice over focus. + // Do not emit the .layoutChanged unless the banner is focused to avoid capturing + // the voice over focus. if bannerView.accessibilityElementIsFocused() { UIAccessibility.post(notification: .layoutChanged, argument: bannerView) } diff --git a/ios/MullvadVPN/SelectLocationViewController.swift b/ios/MullvadVPN/SelectLocationViewController.swift index b9d52107fa..5f7652477c 100644 --- a/ios/MullvadVPN/SelectLocationViewController.swift +++ b/ios/MullvadVPN/SelectLocationViewController.swift @@ -272,8 +272,8 @@ class SelectLocationViewController: UIViewController, UITableViewDelegate { // MARK: - Private private func updateTableHeaderTopLayoutMargin() { - // When contained within the navigation controller, we want the distance between the navigation title - // and the table header label to be exactly 24pt. + // When contained within the navigation controller, we want the distance between + // the navigation title and the table header label to be exactly 24pt. if let navigationBar = navigationController?.navigationBar as? CustomNavigationBar, !showHeaderViewAtTheBottom { diff --git a/ios/MullvadVPN/TunnelManager/PacketTunnelOptions.swift b/ios/MullvadVPN/TunnelManager/PacketTunnelOptions.swift index d6a3578bc5..850c24f37c 100644 --- a/ios/MullvadVPN/TunnelManager/PacketTunnelOptions.swift +++ b/ios/MullvadVPN/TunnelManager/PacketTunnelOptions.swift @@ -11,12 +11,13 @@ import Foundation struct PacketTunnelOptions { /// Keys for options dictionary private enum Keys: String { - /// Option key that holds the `NSData` value with `RelaySelectorResult` encoded using `JSONEncoder`. - /// Used for passing the pre-selected relay in the GUI proocess to the Packet tunnel process. + /// Option key that holds the `NSData` value with `RelaySelectorResult` + /// encoded using `JSONEncoder`. + /// Used for passing the pre-selected relay in the GUI process to the Packet tunnel process. case relaySelectorResult = "relay-selector-result" - /// Option key that holds the `NSNumber` value, which is when set to `1` indicates that the tunnel was started by - /// the system. + /// Option key that holds the `NSNumber` value, which is when set to `1` indicates that + /// the tunnel was started by the system. /// System automatically provides that flag to the tunnel. case isOnDemand = "is-on-demand" } diff --git a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift index 7cf720c959..ea72413456 100644 --- a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift +++ b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift @@ -10,16 +10,19 @@ import XCTest class MullvadVPNScreenshots: XCTestCase { override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. + // Put setup code here. This method is called before the invocation of + // each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + // In UI tests it’s important to set the initial state - such as interface orientation - + // required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. + // Put teardown code here. This method is called after the invocation of + // each test method in the class. } func testTakeScreenshots() { diff --git a/ios/Operations/AlertPresenter.swift b/ios/Operations/AlertPresenter.swift index 6bf4470e23..1af6a9435d 100644 --- a/ios/Operations/AlertPresenter.swift +++ b/ios/Operations/AlertPresenter.swift @@ -24,7 +24,8 @@ public final class AlertPresenter { private static let initClass: Void = { /// Swizzle `viewDidDisappear` on `UIAlertController` in order to be able to /// detect when the controller disappears. - /// The event is broadcasted via `AlertPresenter.alertControllerDidDismissNotification` notification. + /// The event is broadcasted via + /// `AlertPresenter.alertControllerDidDismissNotification` notification. swizzleMethod( aClass: UIAlertController.self, originalSelector: #selector(UIAlertController.viewDidDisappear(_:)), |
