Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- import AVFoundation
- class PlaySoundsViewController: UIViewController {
- var coinSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("/sounds/superman", ofType: "mp3")!)
- var audioPlayer = AVAudioPlayer()
- @IBOutlet weak var PlaySlow: UIButton!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- @IBAction func PlaySlowAction(sender: UIButton) {
- audioPlayer.play()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement