From the course: Code Clinic: Swift

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution overview

Solution overview - Swift Tutorial

From the course: Code Clinic: Swift

Start my 1-month free trial

Solution overview

- [Instructor] Here's an overview of my solution to this problem. This application plays a sound that changes in frequency and amplitude based on the user's touch position on the screen. The background color also changes in hue and saturation as well, but that's more of just for fun. It doesn't have anything to do with the sound. Here's an example of the application. I'll stop the app and go into Xcode. I've created the app using a third-party framework called AudioKit. In AudioKit I created an oscillator object to control the sound. When the touches begin or move, I modify the sound by grabbing the position of the screen as a percentage both vertically and horizontally. I then use those values to update the frequency and amplitude of the oscillator. I also use those same values to adjust the hue and saturation of the view. Throughout this chapter we're going to build this application including setting up the AudioKit framework and writing the code to create and modify sounds.

Contents