diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-10-11 12:47:55 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-11-03 13:30:51 +0100 |
| commit | e46e20f1a0979dfc5e8e21faee961287a2ae94b9 (patch) | |
| tree | eaec5360a7a1b5a1a1c95c5072db4c8cce9b8e08 | |
| parent | 510741ca487ee078bed471a6f6ea12a2a7d0bb3a (diff) | |
| download | mullvadvpn-e46e20f1a0979dfc5e8e21faee961287a2ae94b9.tar.xz mullvadvpn-e46e20f1a0979dfc5e8e21faee961287a2ae94b9.zip | |
CustomSwitchContainer: disable implicit animations when updating opacity
| -rw-r--r-- | ios/MullvadVPN/CustomSwitchContainer.swift | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ios/MullvadVPN/CustomSwitchContainer.swift b/ios/MullvadVPN/CustomSwitchContainer.swift index fb2164ee9c..7acafc4495 100644 --- a/ios/MullvadVPN/CustomSwitchContainer.swift +++ b/ios/MullvadVPN/CustomSwitchContainer.swift @@ -52,6 +52,8 @@ class CustomSwitchContainer: UIView { borderShape.cornerRadius = self.bounds.height * 0.5 borderShape.frame = self.bounds + + updateBorderOpacity() } required init?(coder: NSCoder) { @@ -74,7 +76,12 @@ class CustomSwitchContainer: UIView { } private func updateBorderOpacity() { + CATransaction.begin() + CATransaction.setDisableActions(true) + borderShape.opacity = control.isEnabled ? 1 : 0.2 + + CATransaction.commit() } } |
