title: Segmented control not changing index
body: <p>I'm coding a game, and I have a segmented control for the user to select a difficulty level. I've added some simple code inside the cases to check if the index changes, but it doesn't appear to. Here's the code:</p>
  
  <pre><code>@IBAction func chooseOnePlayerDifficulty(_ sender: UISegmentedControl) {
      switch onePlayerGameType {
          case .sluggish:
              onePlayerGameType = typeOfGame.sluggish
              print("Sluggish difficulty selected.")
          case .average:
              onePlayerGameType = typeOfGame.average
              print("Average difficulty selected.")
          case .ninja:
              onePlayerGameType = typeOfGame.ninja
              print("Ninja difficulty selected.")
      }
  }
  </code></pre>
  
  <p>Now, when I test this in the simulator, the only thing that prints to the console is "Average difficulty selected." No matter which one I select. Why is this happening and how do I fix it?</p>
  
  <p>EDIT: I've found an answer that works by asking this question on another forum. Thanks for the help though. Here's the answer from there that worked for me: <a href="https://forums.swift.org/t/segmented-control-isnt-changing-to-the-selected-index/15642/6?u=thisisauzername" rel="nofollow noreferrer">Here is the link to the answer</a></p>