iphone recognize different shapes with finger movement

前端 未结 3 1944
孤城傲影
孤城傲影 2021-02-06 08:55

I\'m developing an application for iPhone, and I want to detect different shapes as my fingers move on iPhone surface. Can anybody help me, how can I detect the different geomet

3条回答
  •  萌比男神i
    2021-02-06 09:34

    There is a sample custom UIGestureRecognizer built inside the iOS SDK documentation which recognizes a checkmark gesture here, specifically in the section entitled "Creating Custom Gesture Recognizers" (couldn't find an easy way to directly link the section). Using this as a template, you should be able write a custom gesture recognizer to correctly recognize your gesture.

    The part you will have to provide yourself is the code which defines for your device what exactly it means to make your particular shape of interest.

    Incidentally, I'm also in the process of writing my own custom UIGestureRecognizer as an example of recognizing a continuous gesture as opposed to the checkmark's discrete gesture recognition as I would have appreciated an example of this previously.

    It is available on Github.

提交回复
热议问题