-1

我需要复制 aUIEvent以便UIView稍后将其转发到 (UIWebView)。这可能吗?如果是这样,我怎样才能实现它?

主 UIWindow 的示例子类

UIEvent *startEvent;

- (void)sendEvent:(UIEvent *)event {
NSSet *touches = [event allTouches];
UITouch *touch = touches.anyObject;
if(touch.phase == UITouchPhaseBegan) {
        startEvent = event; //will only point startEvent to event so startEvent changes each time event changes, but I need to keep the original event when UITouchPhaseBegan.
       //startEvent = [event copy]; //i tried that, but unfortunately it's not working
}

有没有人这样做过,并找到了不会导致应用程序被苹果拒绝的解决方案?……

4

1 回答 1

0

AppDelegate *delegate = [UIApplication sharedApplication].delegate; UIWindow *window = delegate.window;

[窗口发送事件:_事件];

是的,您可以将事件发送到窗口,但您不能创建自己的事件,例如 Touch 事件。

你不能告诉窗口如何处理那个事件

于 2014-07-16T12:28:57.053 回答