What's Updated in SwiftUI and Combine 路 Combine Improvements Since WWDC | raywenderlich.com

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/6178532-what-s-updated-in-swiftui-and-combine/lessons/3

I tried the code from the last example, and it crashes when I run it in Xcode 11.2 in the simulator and when returning from the detailview. Error:

2019-11-02 11:22:31.515778+0100 Employees[80175:15321750] *** Assertion failure in -[UINavigationController popToViewController:transition:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3900.12.15/UINavigationController.m:8129

2019-11-02 11:22:31.519144+0100 Employees[80175:15321750] *** Terminating app due to uncaught exception 鈥楴SInternalInconsistencyException鈥, reason: 鈥楾ried to pop to a view controller that doesn鈥檛 exist.鈥

Hi! Thanks for the comment - yes, indeed it looks like you ran into something that I didn鈥檛 catch when I ran through my code! It turns out that the NavigationView and TabViews were inside out (the TabView should be the outer view, not the NavigationView). I鈥檓 sending updated code to the team now to push up to the site - I鈥檒l let you know when that is ready!

what鈥檚 the point of leaving the var moc = AppDelegate.currentContext (in 3:00 minutes) after you injected the context through @Environment ? I guess it should be removed.

Yes you鈥檙e right - that should be removed - an oversight on my part!