开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜