开发者

How to find touch on UIwindow?

开发者 https://www.devze.com 2023-01-14 04:38 出处:网络
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 f

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

精彩评论

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