Created
June 7, 2022 10:57
-
-
Save Vzhukov74/757a7dc0045176dec01561a366240205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct HalfTransparentBg: ViewModifier { | |
func body(content: Content) -> some View { | |
ZStack { | |
Color(white: 0, opacity: 0.5).ignoresSafeArea() | |
content | |
} | |
} | |
} | |
extension View { | |
func halfTransparentBg() -> some View { | |
modifier(HalfTransparentBg()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment