Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import UIKit
  2. import AVFoundation
  3. class PlaySoundsViewController: UIViewController {
  4.  
  5. var coinSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("/sounds/superman", ofType: "mp3")!)
  6. var audioPlayer = AVAudioPlayer()
  7.  
  8.  
  9. @IBOutlet weak var PlaySlow: UIButton!
  10. override func viewDidLoad() {
  11. super.viewDidLoad()
  12.  
  13. // Do any additional setup after loading the view.
  14. }
  15.  
  16. override func didReceiveMemoryWarning() {
  17. super.didReceiveMemoryWarning()
  18. // Dispose of any resources that can be recreated.
  19. }
  20.  
  21. @IBAction func PlaySlowAction(sender: UIButton) {
  22. audioPlayer.play()
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement