... there is yet another problem beyond animations. When you use applyIf with a view that contains a ๏ผ State property, all state will be lost when the condition changes. ๐ objc.io
... the outermost type is a _ConditionalContent. This is an enum that will eithercontain the value from executing the if branch, or the value from executing the else branch. ๐ objc.io
extensionView {/// transform self if `condition` is met./// ```/// view.if(condition) { $0.hidden() }/// ```@ViewBuilderpublicfunc`if`<M:View>(_condition: Bool, thentransform: (Self) -> M ) ->some View {if condition { transform(self) } else { self } }/// transform self if `condition` is met, otherwise do another transform./// ```/// view.if(condition) then: { $0.hidden() } else: { $0.border() }/// ```@ViewBuilderpublicfunc`if`<T:View, F:View>(_condition: Bool, thendoThis: (Self) -> T, elsedoThat: (Self) -> F ) ->some View {if condition { doThis(self) } else { doThat(self) } }}