diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2023-08-21 16:07:26 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2023-08-21 16:07:26 +0200 |
| commit | da118437528344eb83281629af2c2ebd7313842f (patch) | |
| tree | a15e0f0d45b47cdb22d33463958b57221c9ac436 | |
| parent | 84e530369b4fd1bdabbe4ee0d60ae38a03be2583 (diff) | |
| parent | c994b7c32073bd12bc9502069bc1cec44e47a824 (diff) | |
| download | mullvadvpn-da118437528344eb83281629af2c2ebd7313842f.tar.xz mullvadvpn-da118437528344eb83281629af2c2ebd7313842f.zip | |
Merge branch 'fix-swiftlint-warning-computed_accessors_order-ios-266'
5 files changed, 37 insertions, 37 deletions
diff --git a/ios/MullvadVPN/Notifications/NotificationManager.swift b/ios/MullvadVPN/Notifications/NotificationManager.swift index a1b5949e5e..11da16407f 100644 --- a/ios/MullvadVPN/Notifications/NotificationManager.swift +++ b/ios/MullvadVPN/Notifications/NotificationManager.swift @@ -16,6 +16,9 @@ final class NotificationManager: NotificationProviderDelegate { private var inAppNotificationDescriptors: [InAppNotificationDescriptor] = [] var notificationProviders: [NotificationProvider] { + get { + _notificationProviders + } set(newNotificationProviders) { dispatchPrecondition(condition: .onQueue(.main)) @@ -29,9 +32,6 @@ final class NotificationManager: NotificationProviderDelegate { _notificationProviders = newNotificationProviders } - get { - _notificationProviders - } } weak var delegate: NotificationManagerDelegate? { diff --git a/ios/MullvadVPN/View controllers/Login/AccountTextField.swift b/ios/MullvadVPN/View controllers/Login/AccountTextField.swift index d31310a757..133c1b6b2c 100644 --- a/ios/MullvadVPN/View controllers/Login/AccountTextField.swift +++ b/ios/MullvadVPN/View controllers/Login/AccountTextField.swift @@ -64,13 +64,13 @@ class AccountTextField: CustomTextField, UITextFieldDelegate { } var autoformattingText: String { + get { + inputFormatter.formattedString + } set { inputFormatter.replace(with: newValue) inputFormatter.updateTextField(self) } - get { - inputFormatter.formattedString - } } var parsedToken: String { @@ -134,9 +134,6 @@ class AccountTextField: CustomTextField, UITextFieldDelegate { // MARK: - Accessibility override var accessibilityValue: String? { - set { - super.accessibilityValue = newValue - } get { if text?.isEmpty ?? true { return "" @@ -144,5 +141,8 @@ class AccountTextField: CustomTextField, UITextFieldDelegate { return super.accessibilityValue } } + set { + super.accessibilityValue = newValue + } } } diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsSwitchCell.swift b/ios/MullvadVPN/View controllers/Settings/SettingsSwitchCell.swift index 476287146f..13be87f52c 100644 --- a/ios/MullvadVPN/View controllers/Settings/SettingsSwitchCell.swift +++ b/ios/MullvadVPN/View controllers/Settings/SettingsSwitchCell.swift @@ -54,49 +54,49 @@ class SettingsSwitchCell: SettingsCell { // MARK: - Accessibility override var accessibilityTraits: UIAccessibilityTraits { - set { - super.accessibilityTraits = newValue - } get { // Use UISwitch traits to make the entire cell behave as "Switch button" switchContainer.control.accessibilityTraits } + set { + super.accessibilityTraits = newValue + } } override var accessibilityLabel: String? { - set { - super.accessibilityLabel = newValue - } get { titleLabel.text } + set { + super.accessibilityLabel = newValue + } } override var accessibilityValue: String? { - set { - super.accessibilityValue = newValue - } get { self.switchContainer.control.accessibilityValue } + set { + super.accessibilityValue = newValue + } } override var accessibilityFrame: CGRect { - set { - super.accessibilityFrame = newValue - } get { UIAccessibility.convertToScreenCoordinates(self.bounds, in: self) } + set { + super.accessibilityFrame = newValue + } } override var accessibilityPath: UIBezierPath? { - set { - super.accessibilityPath = newValue - } get { UIBezierPath(roundedRect: accessibilityFrame, cornerRadius: 4) } + set { + super.accessibilityPath = newValue + } } override func accessibilityActivate() -> Bool { diff --git a/ios/MullvadVPN/Views/CustomTextView.swift b/ios/MullvadVPN/Views/CustomTextView.swift index 2d90dcf29e..e30c657579 100644 --- a/ios/MullvadVPN/Views/CustomTextView.swift +++ b/ios/MullvadVPN/Views/CustomTextView.swift @@ -19,12 +19,12 @@ class CustomTextView: UITextView { /// Placeholder string var placeholder: String? { - set { - placeholderTextLabel.text = newValue - } get { placeholderTextLabel.text } + set { + placeholderTextLabel.text = newValue + } } /// Placeholder text label @@ -56,9 +56,6 @@ class CustomTextView: UITextView { } override var accessibilityLabel: String? { - set { - super.accessibilityLabel = newValue - } get { if self.text.isEmpty { return placeholderTextLabel.text @@ -66,12 +63,12 @@ class CustomTextView: UITextView { return super.accessibilityLabel } } + set { + super.accessibilityLabel = newValue + } } override var accessibilityPath: UIBezierPath? { - set { - super.accessibilityPath = newValue - } get { if roundCorners { return UIBezierPath( @@ -82,6 +79,9 @@ class CustomTextView: UITextView { return UIBezierPath(rect: accessibilityFrame) } } + set { + super.accessibilityPath = newValue + } } private var notificationObserver: Any? diff --git a/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift b/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift index 9c88b9158c..36f6c2f1d4 100644 --- a/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift +++ b/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift @@ -237,14 +237,14 @@ public final class TunnelMonitor: TunnelMonitorProtocol { private var _onEvent: ((TunnelMonitorEvent) -> Void)? public var onEvent: ((TunnelMonitorEvent) -> Void)? { - set { + get { nslock.withLock { - _onEvent = newValue + return _onEvent } } - get { + set { nslock.withLock { - return _onEvent + _onEvent = newValue } } } |
