Detect if drawing a path is a circle/rectangle in xcode

后端 未结 2 934
青春惊慌失措
青春惊慌失措 2020-12-19 19:55

I want to implement a auto complete feature for a drawing app. Once a free hand object is drawn, I want to detect the type of object (circle/rectangle/triangle) and based on

2条回答
  •  醉话见心
    2020-12-19 20:33

    You can iterate through UIBezierPath points with CGPathApply(..) method. Look here for example.

    But you should determine shape type somehow - it's mathematical task and approach depends on your input data.

提交回复
热议问题