Draw a path with variable width in iOS

后端 未结 2 1840
予麋鹿
予麋鹿 2021-01-22 00:14

I am working on a writing application, My writing is working fine, but what I want to implement is variable stroke width, so that the writing is very realistic

2条回答
  •  一生所求
    2021-01-22 00:50

    In your touchesBegan: method, UItouch is supplied.
    UITouch has below instance functions,

    – locationInView:
    – previousLocationInView:
    

    And below property

    @property(nonatomic, readonly) NSTimeInterval timestamp
    

    From the above, i think you can easily calculate velocity.I didn't go through any of mentioned links.I just want to give you an idea of how to calculate velocty based on touch object.

提交回复
热议问题