This project solves the problem given at this Github account. For completness I left the original text and task description.
Build a small piano like application in Swift with white and black keys, playing a sound on pressing the keys.
IMPORTANT: Don't use Storyboards but purely code to create the views. A starting point for such as structure is given in the SwiftPianoTemplate XCode project.
- View code manually written with UIKit's UIViews (no Storyboards)
- Touchable black and white keys
- Different sounds played for black and white keys
- Layouting with black keys "overlapping" the white keys as in a real piano
- Visual feedback on touching the keys
- Correct piano tone scales on "playing" the keys
This project contains a sample starter code for a project programmatically creating UIViews instead of Storyboards. Feel free to use this starter code for your task.
The directory grand-piano-mp3-sounds
contains sample sounds you can use for this task. Alternatively you can use sounds from https://github.com/pffy/mp3-piano-sound
or other sample sounds of your preference.