mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 05:53:41 +00:00
20 lines
408 B
Swift
20 lines
408 B
Swift
import SwiftUI
|
|
|
|
struct RedrawOnViewModifier: ViewModifier {
|
|
@State private var changeFlag: Bool
|
|
|
|
init(changeFlag: Bool) {
|
|
self.changeFlag = changeFlag
|
|
}
|
|
|
|
func body(content: Content) -> some View {
|
|
content.opacity(changeFlag ? 1 : 1)
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func redrawOn(change flag: Bool) -> some View {
|
|
modifier(RedrawOnViewModifier(changeFlag: flag))
|
|
}
|
|
}
|