How to differentiate whether a user is tapping the screen with his finger or an apple pencil?
<p>The App supports iPad Pro and it has to work with the Apple Pencil. What I would like to do is to differentiate whether the user is using the Apple Pencil or his finger.</p>

<p>Something like:</p>

<pre><code>if( the user is pressing the screen with his finger){
    do something
} else if ( the user is pressing the screen with an Apple Pencil){
    do something else
}
</code></pre>

<p>I found the <code>UITouchTypeStylus</code> attribute but was not able to know how it works.</p>

<p>My main problem is that there are really few examples, and they are written in swift, but I am working in objective C. And I am not able to really understand these samples.</p>

<p>Look at this, this is a function from a  sample that I found on the apple developer:</p>

<pre><code>func addPointsOfType(var type: LinePoint.PointType, forTouches touches: [UITouch], toLine line: Line, currentUpdateRect updateRect: CGRect) -&gt; CGRect {
    var accumulatedRect = CGRect.null

    for (idx, touch) in touches.enumerate() {
        let isStylus = touch.type == .Stylus // I think that what I'm looking for is something like that

        [...]
}
</code></pre>

<p>I don't really have the time to learn swift now, unfortunately... This is blocking me completely.</p>

<p>So if someone could give me some samples in Objective C that will allow me to work with the Apple Pencil, or just a beginning. A tutorial on a web site would be perfect also but I don't think there are any.</p>