diff options
Diffstat (limited to 'ios/MullvadVPN/Extensions/View+Modifier.swift')
| -rw-r--r-- | ios/MullvadVPN/Extensions/View+Modifier.swift | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ios/MullvadVPN/Extensions/View+Modifier.swift b/ios/MullvadVPN/Extensions/View+Modifier.swift new file mode 100644 index 0000000000..2f89ec9dd8 --- /dev/null +++ b/ios/MullvadVPN/Extensions/View+Modifier.swift @@ -0,0 +1,21 @@ +// +// View+Modifier.swift +// MullvadVPN +// +// Created by Steffen Ernst on 2025-01-21. +// Copyright © 2025 Mullvad VPN AB. All rights reserved. +// + +import SwiftUI + +// A view modifier that can be used to conditionally apply other view modifiers. Here an example +// .apply { +// if #available(iOS 16.4, *) { +// $0.scrollBounceBehavior(.basedOnSize) +// } else { +// $0 +// } +// } +extension View { + func apply<V: View>(@ViewBuilder _ block: (Self) -> V) -> V { block(self) } +} |
