3

I'm making a drawing tool with UIView's touch events.

The problem is

touchesMoved event doesn't occur when trying to move very closely right after touch began.

so it's very difficult to draw 2~3 pixels line.

enter image description here See it's just one pixel.

But in iOS Simulator it works fine.

enter image description here

I thought it's device's problem But in SketchBookX(popular drawing app), works fine, too.

enter image description here

I'm not using UIScrollView or UIGuestureRocognizer.

Please help me to solve this problem.

  • I took some screenshots AND 'newbies are not allowed to post images..' X(
Minsu
  • 81
  • 5

2 Answers2

0

Oh FINALLY I found my fault!

enter image description here

If touch moves very short after 'touchesBegan', doesn't fire 'touchesMoved'.

But when 'touchesEnd' it gives moved point X(

It's little odd but finally i've done with it :)

Minsu
  • 81
  • 5
  • can you told me how can i draw in touch event ? i read that to draw you should use drawrec function ? – kartal May 22 '12 at 22:50
0

One thing is that on simulator input device is a mouse, where point of 'touch' is stricltly defined. Touchscreen works a bit different - 2-3px can be filtered as a noise.

People usually interpolate 'missing' pixels using UIBezierPath: see Increase frequency calls of touchesMoved

Community
  • 1
  • 1
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
  • I'm already using interpolation for very fast touch movement. But it can't solve my problem. Without any touchesMoved event, it's just nothing different with a pixel :( – Minsu Mar 19 '12 at 12:45