0

In my app some of UIViews don't react on Apple Pencil. When I make touch by finger, all works fine. I supposed that this might be caused by adding new property type in iOS 9. And I tried to change the type of touches:

touch.type = UITouchTypeDirect;

But this is readonly property. Does exist any way to make equal touch by finger and touch by Apple Pencil?

How do I make my app react on Apple Pencil?

mgv
  • 347
  • 1
  • 3
  • 9

1 Answers1

1

UITouch class determines whether the touch is made by a stylus or by a finger, as stylus have a pinpoint touch and finger has a soft corner touch. You don't have to specify any setting for apple pencil.

In the touches began method,

you can differntiate the touches as:

   if(touch.type==UITouchTypeStylus){
               //perform stylus action
   }
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109