按下突出显示按钮

时间:2016-09-14 20:14:45

标签: ios swift

如何通过按下来突出显示我用图像替换为普通按钮的图像的按钮?当我按下此按钮Picture时,操作将被激活,但按钮本身没有反馈。

import UIKit
import AVFoundation

class PlayMusicViewController: UIViewController {

    var audioPlayer: AVAudioPlayer!

    override func viewDidLoad() {
        super.viewDidLoad()

        var daten = NSBundle.mainBundle().pathForResource("Kool_Savas_Auge", ofType: "mp3")

        var filePathUrl = NSURL.fileURLWithPath(daten!)

        do{
            audioPlayer = try AVAudioPlayer(contentsOfURL: filePathUrl, fileTypeHint: nil)

                }
        catch let err as NSError{
            print(err.debugDescription);
        }

    }

    @IBAction func PlayMusic(sender: UIButton) {

        audioPlayer.play()

    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

0 个答案:

没有答案