From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Using Apple Pencil

Using Apple Pencil

- [Instructor] The Apple Pencil adds more functionality to tablets then just FingerTouch, even though you use the same code. Let's do a quick explore of the Apple Pencil, and see how easy it is to add support in your app. So go ahead and download the starter app. It's a SWF playground I'll be using on my iPad Pro so I can demo my pencil easily. I've made a simple app that has a label on top, a square label, and with a few support methods added. And a whole bunch of already set up properties with the correct types. All UI view controllers have methods to respond to touch events. Head down to the Touch events mark. The first of these is the touchesBegan method. This tells the app there has been a touch. Add the following to this method. squareText = "Touched". And then updateDisplay, which I'll talk a little bit later about. And we're gonna use touches, which is the parameter we have in touchesBegan, with a Set of UITouch, so touches. The second method is after a touch has begun, and…

Contents