# How can i create a UIEvent or UITouch instance?

**URL:** <https://forums.swift.org/t/how-can-i-create-a-uievent-or-uitouch-instance/38408>\
**Category:** Using Swift\
**Tags:** off-topic\
**Created:** [July 13, 2020, 9:42am UTC](https://forums.swift.org/t/how-can-i-create-a-uievent-or-uitouch-instance/38408 "2020-07-13T09:42:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frery](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/frery/32/9023_2.png) [@Frery](https://forums.swift.org/u/Frery)\
**Post date:** [July 13, 2020, 9:42am UTC](https://forums.swift.org/t/how-can-i-create-a-uievent-or-uitouch-instance/38408/1 "2020-07-13T09:42:18Z")

</div>

Hi, everybody here.  
Here are my business:

We want to cast our cell phone screen to other device screen, but users can touch or control APP content via other device screen, we can call it reverse control.

When i touch the other device screen, our link protocol between my cell phone and other device, will send protocol data to my app, E.g: location point, timestamp.

So, when APP get the protocol data, we can seek the UI object.

The question here is:  
How can i create a UIEvent or UITouch instance, so i can call '`open func sendEvent(_ event: UIEvent)`' ?  
If not, what can i do here?  
Any solutions here are welcomed.  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![jonprescott](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jonprescott](https://forums.swift.org/u/jonprescott)\
**Post date:** [July 13, 2020, 4:38pm UTC](https://forums.swift.org/t/how-can-i-create-a-uievent-or-uitouch-instance/38408/2 "2020-07-13T16:38:16Z")

</div>

Best to ask over on some Apple-specific site (Apple Developer forums, StackOverflow, etc.). Your questions does not apply to Swift the language, rather it's aimed at Apple frameworks.

More importantly, this sounds like a security disaster waiting to happen.

---

<div class="post-metadata">

**Author:** ![Frery](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/frery/32/9023_2.png) [@Frery](https://forums.swift.org/u/Frery)\
**Post date:** [August 11, 2020, 5:33am UTC](https://forums.swift.org/t/how-can-i-create-a-uievent-or-uitouch-instance/38408/3 "2020-08-11T05:33:45Z")

</div>

Thanks for your comments.  
Yes, for sure, there are some risk of security. We have stopped to do this work.
