title: Swift: Trying to rotate a drawn shape?
body: <p>I'm having trouble trying to rotate the shape I have drawn in the following code: I tried using:  </p>
  
  <pre><code>triangle.transform = triangle.transform.rotated(by: 3.14159)
  </code></pre>
  
  <p>but that gives me an error of "value of type 'CATransform3D' has no member 'rotated'". I'm not sure how to rotate the shape.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      let trianglePath = UIBezierPath()
      trianglePath.move(to: CGPoint(x: UIScreen.main.bounds.size.width * 0.5, y: UIScreen.main.bounds.height * 0.5))
      trianglePath.addLine(to: CGPoint(x: (UIScreen.main.bounds.size.width * 0.5) + 100, y: (UIScreen.main.bounds.height * 0.5) - 50))
      trianglePath.addLine(to: CGPoint(x: (UIScreen.main.bounds.size.width * 0.5) + 100, y: (UIScreen.main.bounds.height * 0.5) + 50))
      trianglePath.close()
  
      let triangle = CAShapeLayer()
      triangle.path = trianglePath.cgPath
      triangle.fillColor = UIColor.gray.cgColor
      self.view.layer.addSublayer(triangle)
  }
  </code></pre>