title: How can I get a var within a class to be altered by a method of the same class?
body: <p>I have the following code:</p>
  <pre><code>class QuizQuestions {
      
      var gender = &quot;it&quot;
      
      func chooseGender(genderButton: String) {
          if genderButton == &quot;Female&quot; {
              gender = &quot;she&quot; }
          print(gender)
      }
      
      lazy var questions = [&quot;Does \(gender) run?&quot;, &quot;Is \(gender) fun?&quot;]
      
  }
  </code></pre>
  <p>The function takes as an input the text of a UIButton. What I want is for, when the genderButton is pressed, the var gender to be updated to &quot;she&quot;, and for that to be reflected in the 'questions' array.
  The print statement in the method shows me that 'gender' is now 'she', however printing 'question[0]' will still print &quot;Does it run?&quot;, not &quot;Does she run?&quot;</p>
  <p>Why is this, and how can I make it work? TIA!</p>