-
-
Save laevandus/c0858b81899c7e0c183203d5572df590 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 AppearDisappearView: View { | |
@State private var isDrizzleHidden = true | |
var body: some View { | |
VStack(spacing: 16) { | |
HStack { | |
Image(systemName: "cloud.fill") | |
Image(systemName: "cloud.drizzle.fill") | |
.symbolEffect(.disappear, isActive: isDrizzleHidden) | |
Image(systemName: "cloud.heavyrain.fill") | |
} | |
.imageScale(.large) | |
HStack { | |
Image(systemName: "cloud.fill") | |
if !isDrizzleHidden { | |
Image(systemName: "cloud.drizzle.fill") | |
.transition(.symbolEffect(.automatic)) | |
} | |
Image(systemName: "cloud.heavyrain.fill") | |
} | |
.imageScale(.large) | |
Button("Appear/Disapper") { | |
isDrizzleHidden.toggle() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment