title: Repeat functions for x amount of times in Swift using Xcode 6.4
body: <p>I have an app that uses 3 functions which use NSTimer which are called consecutively or one after the other. I would like for these functions to be repeated for x amount of times because I have an @IBOutlet called <code>repsField</code> which creates a value that is stored in the global variable <code>repetitions</code>which is by default set to 0 until a user changes this value using the @IBOutlet. </p>
  
  <p>Basically, I'd like to multiply the amount of times that the functions are called by the global variable <code>repetitions</code>. How can I do this?</p>
  
  <p>Screenshot: </p>
  
  <p><a href="https://i.stack.imgur.com/PfDBQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PfDBQ.png" alt="enter image description here"></a></p>
  
  <p>Here's an example of one of the timers...</p>
  
  <pre><code>func start1() {
      if timerRunning==false{ // Timer will start
          timer=NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("Counting1"), userInfo: nil, repeats: true)
          timerRunning=true
      }
  }
  
  func Counting1(){
      timerCount+=1 timerLabel.text="\(timerCount) secs"
      if timerRunning==true &amp;&amp; timerCount &gt;= timerMaximum {
          stop()
          intervalAlert()
          start2()
      }
  }
  </code></pre>
  
  <p>Please get back to me as soon as possible</p>