inamiy / iOS15-SwiftUI-Navigation-Bug

Demonstrates SwiftUI Navigation behavior change from iOS 14 to iOS 15 which disallows single-source-of-truth state management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iOS15-SwiftUI-Navigation-Bug

Demonstrates SwiftUI Navigation behavior change from iOS 14 to iOS 15 which disallows single-source-of-truth state management.

2021/09/24 18:28 EDIT

Using .navigationViewStyle(.stack) helps avoiding this bug.

https://twitter.com/chriseidhof/status/1441330150872735745

Xcode 12.5.1 / iOS 14.5

NOTE: Array of isActives was already broken in iOS 14, but UI transition was working correctly.

ios14.mov

Xcode 13.0 / iOS 15.0

Both aray of isActives and UI transition are broken. (This occurs only when single @Published (a.k.a. single-source-of-truth) is used, and will be no problem if multi-@Published or multi-@State are used)

ios15.mov

About

Demonstrates SwiftUI Navigation behavior change from iOS 14 to iOS 15 which disallows single-source-of-truth state management.

License:MIT License