0

I have created a UIWindow global object for my application like

#define APP_DELEGATE_WINDOW ((UIWindow*)((AppDelegate*)[[UIApplication sharedApplication] delegate])).window

Now in one UIViewController, I m adding a subview with a transparent background to the APP_DELEGATE_WINDOW.

I want such a functionality that, when I touch on the transparant background added on the APP_DELEGATE_WINDOW, I want to close the subview.

How can I detect touch on APP_DELEGATE_WINDOW, so that on that Touch event, I can close the view with its subviews.

1 Answer 1

1

Now in one UIViewController, I m adding a subview with a transparent background to the APP_DELEGATE_WINDOW.

You could add a UITapGestureRecognizer to the subview with the transparent background. Then in the handler of the gesture recognizer, you would remove the view controller with its views.

1
  • Thanks that was a great help... For no reason I was searching for the detect of touch on UIWindow, thanks again.
    – Kanan Vora
    Aug 4, 2012 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.