-1

I am using swift gesture in my app But these swipes are just up - down - right and left - I want some thing more !!! I want to have swipe gesture from one point to another point with x and y for example from one point in the middle of the screen to another point near right with special X and Y and the most important thing is that how can I use this code to all devices?! because when I am using for example iPhone 4s it is more different than iPad pro screen

Saeed Rahmatolahi
  • 1,317
  • 2
  • 27
  • 60

1 Answers1

0

One way you could do this is by adding a transparent view to the area of the screen that you want a gesture to be recognized in. So, if we consider your case, you could add a view that is presented over the center of its superview to some point near the right of its superview. Set the isOpaque property to false. Add a swipe gesture to this view with the target being the superview, and the action being the method of the superview that you want to execute when the swipe gesture is recognized on the newly added transparent subview.

hvasam
  • 304
  • 4
  • 12