Move object i y-direction when entire screen is touched.

Hello guys, Im new to Xcode and as the title may suggest Im looking for a script that will move an object when the entire screen is touched.

If possible the velocity must remain constant.


Thank you so much for any help, and sorry for my noob skills

Replies

You would define a tapGesture associated to the view of the controller (the top level view).


In the Action associated to this tap gesture, you will move the object you want.

Here you can use animation to get the continuous move you want.

Of course you have to define an IBOutlet for this object to change its frame, hence its position on screen.


You have also to decide how to stop the move.