title: How can I make my increment or Swift 3 Friendly?
body: <pre><code>static func randomShape() -&gt; Shape {
      // Find out count of possible shapes
      var maxValue = 0
      while let _ = self.init(rawValue: ++maxValue) {}
      // Generate random number from number of shapes
      let randomNumber = Int(arc4random_uniform(UInt32(maxValue)))
      // Create and return shape
      let shape = self.init(rawValue: randomNumber)!
  
      return shape
  }
  </code></pre>
  
  <p>Focus on the <code>while let _ = self.init(rawValue: ++maxValue) {}</code></p>
  
  <p>I et the Error that <code>++</code> has been deprecated from Swift, However I don't know how i can change my method to still function right.</p>
  
  <p>I tried MaxValue += 1 and i get the error</p>
  
  <pre><code>'+=' produces '()', not the expected contextual result type 'Int'
  </code></pre>
  
  <p>Your help is much appreciated!</p>