title: How to fix 'Cannot use mutating member on immutable value: 'self' is immutable' error in Xcode
body: <p>I create a random number and assign it to the variable <code>randomNumber</code>. Then when I try to append the random number as an index for the <code>emojis</code> array to the empty array <code>arrayOfEmojis</code> I get the error: </p>
  
  <blockquote>
    <p>'Cannot use mutating member on immutable value: 'self' is immutable'</p>
  </blockquote>
  
  <p>Im also getting errors from the emoji?</p>
  
  <pre><code>import GameKit
  
  struct EmojiProvider {
      var emojis = ["", "", "", "", "", "", "", "", "☺️", "", "", "", "", "", "", ""]
      var arrayOfEmojis: [String]
  
      func generateEmoji() -&gt; [String] {
          for i in 1...3 {
              var randomNumber = GKRandomSource.sharedRandom().nextInt(upperBound: emojis.count)
              arrayOfEmojis.append(emojis[randomNumber]) //error!
          }
          return arrayOfEmojis
      }
  }
  </code></pre>