Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/appbrewery/Xylophone-iOS13
Learn Autolayout by Building a Musical Instrument - The Complete iOS Development Bootcamp
https://github.com/appbrewery/Xylophone-iOS13
Last synced: 30 days ago
JSON representation
Learn Autolayout by Building a Musical Instrument - The Complete iOS Development Bootcamp
- Host: GitHub
- URL: https://github.com/appbrewery/Xylophone-iOS13
- Owner: appbrewery
- Created: 2019-07-02T08:34:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T16:41:22.000Z (over 1 year ago)
- Last Synced: 2024-08-03T17:18:00.817Z (4 months ago)
- Language: Swift
- Homepage: https://www.appbrewery.co
- Size: 4.69 MB
- Stars: 101
- Watchers: 5
- Forks: 511
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-open-source-ios-apps - Xylophone
README
![App Brewery Banner](Documentation/AppBreweryBanner.png)
# Xylophone
## Our Goal
The goal of this tutorial is to dive into a simple iOS recipe - how to play sound and use an Apple library called AVFoundation. The most important skill of a great programmer is being able to solve your own problems. We’ll do that by exploring StackOverflow, Apple Documentation and learning how to search for solutions effectively. By learning to use these tools, you’ll be able to start adding custom features to an app and get it to do what you want it to.
## What you will create
You will be making your first musical instrument! Music apps are so popular on the App Store that they even get their own category. So in this module, we’re going to make a colourful XyloPhone app. Get it? Ok, the jokes are bad, but remember, I only wrote the good ones...
## What you will learn
* How to play sound using AVFoundation and AVAudioPlayer.
* Understand Apple documentation and how to use StackOverflow.
* Functions and methods in Swift.
* Data types.
* Swift loops.
* Variable scope.
* The ViewController lifecycle.
* Error handling in Swift.
* Code refactoring.
* Basic debugging.## Replacement Code
```
import UIKit
import AVFoundationclass ViewController: UIViewController {
var player: AVAudioPlayer!override func viewDidLoad() {
super.viewDidLoad()
}@IBAction func keyPressed(_ sender: UIButton) {
playSound()
}
func playSound() {
let url = Bundle.main.url(forResource: "C", withExtension: "wav")
player = try! AVAudioPlayer(contentsOf: url!)
player.play()
}
}
```>This is a companion project to The App Brewery's Complete App Development Bootcamp, check out the full course at [www.appbrewery.co](https://www.appbrewery.co/)
![End Banner](Documentation/readme-end-banner.png)