title: What is causing a "EXC_Bad_Instruction" error in this code?
body: <p>From my understanding, the error is coming from something being set to &quot;nil&quot;. The only thing set to &quot;nil&quot; in my code is the userInfo which should be &quot;nil&quot; since there will never be any data there. Any help is appreciated!</p>
  <pre><code>import UIKit
      
  class ViewController: UIViewController {
      let eggTimes = [
          &quot;soft&quot;: 300, &quot;medium&quot; : 420, &quot;hard&quot; : 720 ]
      
      var secondsRemaining = 60
      
      var timer = Timer()
      
      @IBAction func hardnessSelected(_ sender: UIButton) {
         
          timer.invalidate()
          
          let hardness = sender.currentTitle!
          
          secondsRemaining = eggTimes[hardness]!
      
          timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
      }
          
      @objc func updateTimer() {
          //example functionality
          if secondsRemaining &gt; 0 {
              print(&quot;\(secondsRemaining) seconds to the end of the world&quot;)
              secondsRemaining -= 1
          }
      }
  }
  </code></pre>