Chapter 6. Settings, audio, and shake detection in TimeDown

 

This chapter covers

  • Custom settings
  • Working with audio
  • Detecting motion

Different iOS apps interact with users in different ways. The most common way is visually—I don’t know of an app that doesn’t have a visible UI. Whether it’s through making selections in the app, the position of the device, pushing buttons, or tapping or swiping on the screen, the app can allow for a variety of interactions.

Many times this interaction affects some functionality of the app. Some setting may change the look of the app—pushing a button may change the volume level or shaking the device may mix up pieces of a game. Similarly, the app can give feedback to the user. Like the interaction from the user, feedback can come in various forms. Visual feedback is probably the most common with audio being second.

In this chapter, we’ll look at these concepts and explore how the user can access these ways of interacting and how to use them in an app. You’ll build a simple app that uses the Settings app for setting values. You’ll also use the audio framework to play a sound file for audio feedback. And you’ll use the accelerometer to detect shaking of the device and use that in your UI.

6.1. Settings bundle in iOS projects

6.2. Runtime and time-based UI changes

6.3. Playing audio and vibrating the device

6.4. Detecting and handling device motion

6.5. Summary

sitemap