title: How do I automate the position of a UIViewController container's member view?
body: <p><strong>Scenario:</strong>
  <br/>
  1. UIViewContainer having one (1) child UIViewController. <br/>
  2. I'm using a UIStoryboard.</p>
  
  <p><strong>Goal:</strong>
  <br/>
  To animate the entrance of the child UIViewController's view from the left edge of the container (like a UIActionSheet).
  <p>
  I have initially set the member view to blue.
  <p>
  <strong>Problem:</strong> I can <em>correctly</em> animate the <em>physical coordinates</em> but not the width constraint (nor any other constraint).
  <p>
  <a href="https://i.stack.imgur.com/a7Hds.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a7Hds.png" alt="enter image description here"></a></p>
  
  <p><p></p>
  
  <p>Here's my code:</p>
  
  <p>import UIKit</p>
  
  <pre><code>class HamburgerContainerViewController: UIViewController {
  
      @IBOutlet weak var containerView: UIView!
      var memberView: UIView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          memberView = containerView!.subviews.first!
      }
  
      override func viewDidLayoutSubviews() {
          memberView.backgroundColor = UIColor.blue
          memberView.frame = CGRect(x: 0, y: 0, width: 100, height: 400)
          return
      }
  
  
      @IBAction func DoSomething(_ sender: Any) {
          memberView.translatesAutoresizingMaskIntoConstraints = false
  
          UIView.animate(withDuration: 1.0) { 
               // self.memberView.frame.size.width = 345.0    // ... this works.
               self.memberView.widthAnchor.constraint(equalToConstant: 25.0)  // ...this makes the view slide somewhere else.
              self.view.layoutIfNeeded()
          }
  
      }
  }
  </code></pre>
  
  <p><p>
  Running my code causes the blue member view to side to the upper left of the screen leaving its UIButton &amp; UILabel in its wake.</p>
  
  <p><a href="https://i.stack.imgur.com/kjmUG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kjmUG.png" alt="enter image description here"></a> 
  <p>
  Here's the storyboard:
  <a href="https://i.stack.imgur.com/P8QC1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P8QC1.png" alt="enter image description here"></a>
  <p>
  FYI: Here's a list of constraints upon the member UIViewController's view:</p>
  
  <p><a href="https://i.stack.imgur.com/fP6e9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fP6e9.png" alt="enter image description here"></a></p>