0

Im building an app that needs to detect a swipe gesture, the detector needs to recognize a swipe in any direction (not only Up, Down, Left, Right), the swipe can be in any direction for example somewhere around up and left.

The app features a ball in the middle of the screen, when the user swipes(flings) in any direction the the ball should shoot in that direction, so if the user shoots to a corner the ball should go to the corner of the screen. I don't want to use Unity or any engine, can anyone help me with the code for swift (not swiftUI)? Thank you in advance!

tareq masri
  • 23
  • 1
  • 5
  • Welcome to SO - Please take the [tour](https://stackoverflow.com/tour) and read [How to Ask](https://stackoverflow.com/help/how-to-ask) to improve, edit and format your questions. Without a [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) it is impossible to help you troubleshoot. What have you tried? – lorem ipsum Feb 14 '21 at 00:38
  • Are you looking to do something similar to this? https://medium.com/@nathangitter/building-fluid-interfaces-ios-swift-9732bb934bf5 ... scroll down to **Interface #7: FaceTime PiP** – DonMag Feb 14 '21 at 13:53

0 Answers0