title: Swift 3 - setting a property on an array of views
body: <p>I was previously able to clean up my code by adding multiple views (UIImageViews, UILabels, and UIButtons) to an array and then iterating through the array to make a property change like this:</p>
  
  <pre><code>var hideViews = [imageView1, imageView2, label1, button1, button2]
        for eachView in hideViews {
            eachView.isHidden = true
        }
  </code></pre>
  
  <p>which then became in another version of Swift:</p>
  
  <pre><code>var hideViews = [imageView1, imageView2, label1, button1, button2] as [Any]
        for eachView in hideViews {
            (eachView as AnyObject).isHidden = true
        }
  </code></pre>
  
  <p>I was also able to use this to move several views at once:</p>
  
  <pre><code>for view in viewsToMove {
      (view as AnyObject).frame = CGRect(x: view.frame.origin.x - 30, y: view.frame.origin.y, width: view.frame.width, height: view.frame.height)
  }
  </code></pre>
  
  <p>I am now getting the errors:</p>
  
  <p>Cannot assign to immutable expression of type 'Bool!'</p>
  
  <p>Cannot assign to immutable expression of type 'CGRect!'</p>
  
  <p>Does anybody know what I'm missing here, in order to do this in Swift 3?</p>
  
  <p>Thanks!</p>