I tried to use the KeyWindow but it is not available in an app extension.
Here's what my code looks like :
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentedViewController];
It works in the main application but it doesn't work in the app extension.
Is there a way to do it?