title: Trying to scale a view from it's top left corner
body: <p>I have a child view controller whose view has been added as a subview on the parent view. I want to scale this by 1.1x from its top left corner. I tried doing this:</p>
  
  <pre><code>override func viewDidLoad() {
      self.view.layer.anchorPoint = CGPoint(x: 0, y: 0)
  }
  
  func scaleMyView() {
      self.view.transform = CGAffineTransform(scaleX: 1.1, y: 1.1)
  }
  </code></pre>
  
  <p>But that seems to re-centre the view over it's top left corner and then scale.</p>
  
  <p>After reading some answers on here, I then tried setting the <code>position</code> of the view's layer like this:</p>
  
  <pre><code>let center = self.view.frame.origin
  self.view.layer.anchorPoint = CGPoint(x: 0, y: 0)
  self.view.layer.position = center
  </code></pre>
  
  <p>But that moves the view somewhere to the center of the screen. How can I just make it scale from its top left corner without it moving in the parent view??</p>