diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b2832da Binary files /dev/null and b/.DS_Store differ diff --git a/Xylophone.xcodeproj/project.xcworkspace/xcuserdata/marcwolf.xcuserdatad/UserInterfaceState.xcuserstate b/Xylophone.xcodeproj/project.xcworkspace/xcuserdata/marcwolf.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..12e3378 Binary files /dev/null and b/Xylophone.xcodeproj/project.xcworkspace/xcuserdata/marcwolf.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..b593b04 --- /dev/null +++ b/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcschemes/xcschememanagement.plist b/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..30782db --- /dev/null +++ b/Xylophone.xcodeproj/xcuserdata/marcwolf.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Xylophone.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Xylophone/ViewController.swift b/Xylophone/ViewController.swift index 3a37013..2e9bb36 100644 --- a/Xylophone/ViewController.swift +++ b/Xylophone/ViewController.swift @@ -21,29 +21,26 @@ class ViewController: UIViewController { //Pre-built Apple APIs manual @IBAction func keyPressed(_ sender: UIButton) { - - print("Red got pressed") +// print("Red got pressed") + playSound() } - - @IBAction func keyPressedOrange(_ sender: UIButton) { - print("Orange pressed") - } - - //adding Sound functionality func playSound() { - guard let url = Bundle.main.url(forResource: "C", withExtension: "wav") else { - return - } + guard let url = Bundle.main.url(forResource: "C", withExtension: "wav") else {return} do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default) try AVAudioSession.sharedInstance().setActive(true) - player = try AVAudioPlayer(contentsOf: <#T##URL#>, fileTypeHint: AVFileType.wav.rawValue) - guard let player = player else {return} + player = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.wav.rawValue) + + guard let player = player else { return } player.play() } catch let error { print(error.localizedDescription) } } +// @IBAction func keyPressedOrange(_ sender: UIButton) { +// print("Orange pressed") +// } + }