Help with xCode 6 Soundboard App

Discussion in 'iOS Programming' started by LegendaryW33nie, Apr 4, 2015.

  1. LegendaryW33nie macrumors newbie

    Joined:
    Mar 4, 2014
    #1
    Hello,

    I am trying to develop a soundboard application for iOS and have been getting myself familiar with xCode and Swift for around 2 months now. I've just started to create my own application and have come across a little problem. From the image below, I believe all my code is correctly referenced right now I just don't know how to play the sound when the button is tapped. Any help is appreciated.

    Thanks,

    (Go easy on me if it looks really bad, I'm new :))
     

    Attached Files:

  2. Zelda macrumors member

    Joined:
    Aug 10, 2014
    #2
    Your button method is empty i.e.
    Code:
    @IBAction func introTapped(sender: UIButton ) {
    [COLOR="Red"]You need some code here to play the sound[/COLOR] 
    }
     
     
  3. LegendaryW33nie, Apr 5, 2015
    Last edited by a moderator: Apr 6, 2015

    LegendaryW33nie thread starter macrumors newbie

    Joined:
    Mar 4, 2014
    #3
    What kind of code would I put there though? I have tried something like

    Code:
    if (self.flipSoundPlayer != nil) {
        self.flipSoundPlayer?.play()
    }
    but that doesn't work, no sound plays at all. I don't know the right format to put there to get the sound to play
     
  4. impossiballs, Apr 9, 2015
    Last edited: Apr 9, 2015

    impossiballs macrumors newbie

    impossiballs

    Joined:
    Apr 8, 2015
    #4
    What is self.flipSoundPlayer ? According to your first attachment shouldn't that be self.intro?
     

Share This Page