Tap Dancing - A Gesture’s Story

Want to build an app that lets users interact in different ways? Apple’s gesture recognizers are the perfect tools to allow you to do just that. Regardless of the type of app you’re building, you are going to want your user to be able to do something. Every app has a significant function. Apple’s gestures provide us developers the opportunity to employ many.

I have been working on a project for a couple of weeks now and decided to add in some features so that I could display how easy and achievable interactivity is. The code takes the user’s current location and inputs the longitude, latitude, and altitude into a UIColor’s RGB components. I set this color equal to the view’s background.

From a design perspective, I want to keep the display clean and simple. From a proud developer perspective, I want the user to be able to glance at the data being processed on the backend. The app’s main interface is simply the color that corresponds to the location, and the user can tap on the screen to load the specifics of the location and color data.

The code for the tap gesture

The code is very straightforward. You simply write an IBAction method, sometimes a UIGesture argument is needed, and then add the gesture to the view.

The next gesture I implement is the UILongPressGestureRecognizer. I add in another label that will display the user’s approximate address location when there is a long press on the screen.

The last feature I will show in this post is the UIPanGestureRecognizer. Panning is used for scrolling through your Facebook feed. I implement a star icon that will appear and disappear as the user pans.

Keep in mind that interactivity is not the only way to a successful app. A majority of the time interactivity will be crucial. For the app that I created, I didn’t need to include the tap or long press (and will probably get rid of the pan). It is much more compelling for a user when they can interact with the technology. That being said, don’t overdo it. The gestures that apple has created are well known and more importantly intuitive to their common uses. Pinch to zoom in and out; swipe or pan to scroll; tap to send a message; rotate to rotate an image. Gestures can make an app stand out and come to life.

Notice the range of gestures we are provided with.
Gestures were added for the purposes of this blog.