I have one SwiftUI view which i want to hide on specific condition. Also I want empty space hidden should not remove the view space. is there any way to do this in SwiftUI?
for ex. bellow Text i want to hide if number == 1 and show if number == 0
Text("Test")
.hidden()
how to hive condition in SwiftUI
I can do bellow but its repetitive code.
if number == 1 {
Text("Test")
.hidden()
}
else {
Text("Test")
}
Please suggest better solution.
Thank you for help.