title: Swift Construct for Multiple Choice
body: <p>I have a requirement to construct a multiple choice Q&amp;A iOS app using Swift. At present I am using a "case" construct as shown below. I am faced with two issues:</p>
  
  <ol>
  <li>I don't know how to remove the question (or case) once it has been answered correctly</li>
  <li>This construct becomes cumbersome when I build up hundreds or thousands of questions. </li>
  </ol>
  
  <p>Can someone provide a better way to implement this?</p>
  
  <pre><code>func RandomQuestions () {
      var RandomNumber = arc4random() % 4
  
      switch (RandomNumber) {
  
      case 1:
          QuestionLabel.text = "What is the capital of Austria? "
          Button1.setTitle ("Istanbul", for: UIControlState.normal)
          Button2.setTitle ("Vienna", for: UIControlState.normal)
          Button3.setTitle ("Melbourne", for: UIControlState.normal)
          Button4.setTitle ("Perth", for: UIControlState.normal)
          CorrectAnswer = "2"
  
          break
      case 2:
          QuestionLabel.text = "What is 6 x 7? "
          Button1.setTitle ("12", for: UIControlState.normal)
          Button2.setTitle ("24", for: UIControlState.normal)
          Button3.setTitle ("42", for: UIControlState.normal)
          Button4.setTitle ("48", for: UIControlState.normal)
          CorrectAnswer = "3"
  
          break
      case 3:
          QuestionLabel.text = "What is the name of the yellow Power Ranger? "
          Button1.setTitle ("Willy", for: UIControlState.normal)
          Button2.setTitle ("Mario", for: UIControlState.normal)
          Button3.setTitle ("Ivan", for: UIControlState.normal)
          Button4.setTitle ("Alexander", for: UIControlState.normal)
          CorrectAnswer = "3"
  
          break
      case 4:
          QuestionLabel.text = "How many dwarves in Cinderella"
          Button1.setTitle ("12", for: UIControlState.normal)
          Button2.setTitle ("7", for: UIControlState.normal)
          Button3.setTitle ("3", for: UIControlState.normal)
          Button4.setTitle ("9", for    : UIControlState.normal)
          CorrectAnswer = "2"
  
          break
  
      default:
          break
  </code></pre>