title: How do I fix this code to allow for the timer to begin as a result of the user clicking on the UIAlert?
body: <p>Trying to make a timer start as a result of the UIAlert being clicked on. But I keep getting this error indicating the instances <code>isTimerRunning</code> and <code>runTimer</code> cannot be used on the thirdViewController.</p>
  
  <p>We have been trying to move it around, thinking it is a scope issue, but cannot seem to get it to be ok with those functions.</p>
  
  <p>When we adjusted it to use alert.copyAction, rather than let.. the error changes to "expected declaration".</p>
  
  <pre><code>var seconds = 60
  var timer = Timer()
  var isTimerRunning = false
  var resumeTapped = false
  
  let alert = UIAlertController(title: "Your wing was damaged! There is also a dust storm incoming! You need to repair the wing and escape to the next planet.", message: nil, preferredStyle: .alert)
  
  let copyAction = UIAlertAction(title: "Copy that mission control!", style: .default, handler: { action in
      if isTimerRunning == false {
          runTimer()
      }
  })
  
  func runTimer() {
      timer = Timer.scheduledTimer(timeInterval: 1, target: self,   selector: (#selector(thirdViewController.updateTimer)), userInfo: nil, repeats: true)
  }
  
  @objc func updateTimer() {
      if seconds &lt; 1 {
          timer.invalidate()
      } else {
          seconds -= 1
          timeLabel.text = timeString(time: TimeInterval(seconds))
      }
  }
  
  func timeString(time:TimeInterval) -&gt; String {
      let hours = Int(time) / 3600
      let minutes = Int(time) / 60 % 60
      let seconds = Int(time) % 60
      return String(format:"%02i:%02i:%02i”, hours, minutes, seconds")
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      Timer.scheduledTimer(withTimeInterval: 0.0, repeats: false) { (timer) in
          self.alert.addAction(self.copyAction)
          self.present(self.alert,animated: true, completion: nil)
      }
  }
  </code></pre>