I am displaying overlay custom view in my app. I find the key window, and I add my overlay custom view to the key window's subview. And I set the overlay custom view's layer.zposition to 1.
When I open the UIImagePickerController
or UIDocumentPickerViewController
, I can't touch anything (It works nothing including cancel button in UIImagePickerController
) and my overlay custom view is still exists.
So I'm trying to detect that UIImagePickerController
or UIDocumentPickerViewController
window is open. And If it's opened, I will make my overlay custom view's layer.zposition lower. And the Album will touched.
How can I get the event that UIImagePickerController
or UIDocumentPickerViewController
is opened?
There is two ways to know when these controllers are being presented:
presentViewController:animated:completion:
method for your root view controller, in that this method check if viewControllerToPresent
is class type of UIImagePickerController
or UIDocumentPickerViewController
. and making the needed changes around overlay view.