Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 模拟水龙头,可以吗?_Iphone_Objective C - Fatal编程技术网

Iphone 模拟水龙头,可以吗?

Iphone 模拟水龙头,可以吗?,iphone,objective-c,Iphone,Objective C,我知道可以截取屏幕上的点击,但我想知道是否可以在屏幕的某个点(使用x和y坐标)模拟点击。 谢谢 从这里 如果是非越狱设备,请检查以下内容:(适用于ios 11)。它只在应用程序内部工作。由于您使用的是私有API,您可能会被应用商店拒绝 如果你想模拟系统范围的触摸事件,你必须越狱。 检查越狱设备的这些链接: 向下投票的可能重复,因为-此技术脱离上下文,需要更多使用私有API.upvote的代码(在链接处),因为-合成触摸通常需要访问某种私有API。 UITouch *touch = [[UITo

我知道可以截取屏幕上的点击,但我想知道是否可以在屏幕的某个点(使用x和y坐标)模拟点击。 谢谢

从这里

如果是非越狱设备,请检查以下内容:(适用于ios 11)。它只在应用程序内部工作。由于您使用的是私有API,您可能会被应用商店拒绝

如果你想模拟系统范围的触摸事件,你必须越狱。

检查越狱设备的这些链接:


向下投票的可能重复,因为-此技术脱离上下文,需要更多使用私有API.upvote的代码(在链接处),因为-合成触摸通常需要访问某种私有API。
UITouch *touch = [[UITouch alloc] initInView:view];
UIEvent *eventDown = [[UIEvent alloc] initWithTouch:touch];

[touch.view touchesBegan:[eventDown allTouches] withEvent:eventDown];

[touch setPhase:UITouchPhaseEnded];
UIEvent *eventUp = [[UIEvent alloc] initWithTouch:touch];

[touch.view touchesEnded:[eventUp allTouches] withEvent:eventUp];

[eventDown release];
[eventUp release];
[touch release];