I would like to know what's the difference or why I have a different behavior with my transition animation when I use two different blocks of if statements and when I use if-else statement expecting the same behavior, here some examples:
- The following code works fine and the transition animation behave as expected:
VStack {
homeHeader
columnTitles
if !showPortfolio {
allCoinsListView
.transition(.move(edge: .leading))
}
if showPortfolio {
portfolioListView
.transition(.move(edge: .trailing))
}
Spacer(minLength: 0)
}
- The transition animation doesn't behave as expected:
VStack {
homeHeader
columnTitles
if !showPortfolio {
allCoinsListView
.transition(.move(edge: .leading))
} else {
portfolioListView
.transition(.move(edge: .trailing))
}
Spacer(minLength: 0)
}