Search code examples
iosswiftuiwindow

Possible to create UIWindow to cover up auto segues from push notification?


I am getting a data packet from push notification in my app delegate. If I get this push, I want to segue to appropriate view controller which is a a few VCs deep in my nav stack. It looks really choppy watching the app quickly segue 4 or 5 times to get to appropriate VC.

It looks like I want to create a new UIWindow to cover up my main window while this choppy transition happens. How can I do this with a new UIWindow (have it appear when we know a push is coming through and remove when we reach correct view controller)? Is there another better way to do this?

Thanks a lot!!


Solution

  • If you want to use another UIWindow to initiate this nav stack transition, all you'd have to do is in your application's keyWindow, show some kind of "progress" indication while the transitions are happening in a background window, and then all you'd have to do is set the keyWindow property on your AppDelegate. You can also transition this "setting" with whatever animation you'd like!