Draw a perfect circle from user's touch

后端 未结 7 1681
天命终不由人
天命终不由人 2021-01-29 17:28

I have this practice project that allows the user to draw on the screen as they touch with their fingers. Very simple App I did as exercise way back. My little cousin took the l

7条回答
  •  春和景丽
    2021-01-29 17:45

    Here's a fairly simple way using:

    - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
    

    assuming this matrix grid:

     A B C D E F G H
    1      X X
    2    X     X 
    3  X         X
    4  X         X
    5    X     X
    6      X X
    7
    8
    

    Place some UIViews on the"X" locations and test them for becoming hit ( in sequence ) . If they all get hit in sequence I think it might be fair to let the user say "Well done you drew a circle"

    Sounds okay? ( and simple )

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题