Thank you, but I'm still having fade-in/fade-out with this code...
I did have a sliding transition with a similar code, replacing one Rectangle with another when the condition changes, but what I am looking for in the real app is this:
I have a grid displaying some information (a calendar). When the user swipes the view, I want the data in the grid to be changed, and when that happens, the whole grid to move, with the next month replacing the previous one.
So in my example code I am changing the colour of the Rectangle. That's a new information, sort of, and I expect SwiftUI to re-generate the view, basically replace the old Rectangle with a new one, of a different colour, and to use the transition I've specified. And it almost works, except that instead of the transition I've specified the default fade-in/fade-out transition is used.