How to find touch on UIwindow?
i have four viewcontroller in my UIwindow.i want to interchange my viewcontroller's view among four through UItouch in UIWindow?is it possible to handle touchmoved in ap开发者_开发知识库pdelegate.m file to change the frame origins of those viewcontrollers?
A UIWindow is the parent class of a UIControl (which is what receives touch events) so it cannot handle touch events. You should put one master VC as a subview to the UIWindow, and then use that VC to exchange the subsequent VC's and views.
You can add a UIGestureRecognizer
(UIPanGestureRecognizer
among them) to any view handle the action from any other object using the gesture's:
- (id)initWithTarget:(id)target action:(SEL)action;
精彩评论