Created
September 19, 2021 13:27
-
-
Save SarahAlsharif/94ca599971583299eab9b3a403ca4fef to your computer and use it in GitHub Desktop.
This file contains 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 FlatGlassView : ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.cornerRadius(14) | |
} else { | |
// Fallback on earlier versions | |
content | |
.padding() | |
.frame(height: 50) | |
.cornerRadius(14) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment