Getting rootViewController for iOS13+ & Swift 5

30 views Asked by At

I am trying to get rootViewController like:

UIApplication.shared.keyWindow?.rootViewController

This is working while the app is in the foreground.

My app has also indication for "Voice over IP" and it uses APN for delivering Push Notifications when a new call is being made. The issue with getting a rootViewController occurs, when the user accepts Voip call from iOS Push Notification handlers and starts the app from background (or terminated but re-instantiated).

Is there any concise way how to deal with this situation so I can get a ViewController when app is started from background?

0

There are 0 answers