title: image view with 3D rotation on Swift
body: <p>i'm newbie in programming (i'm a designer previously), and i want to create an iOS app.. basically, it just to create a perspective view of an image.. </p>
  
  <p>im trying to use <code>CIPerspectiveTransform</code> but it isn't what i looking for..</p>
  
  <p>here is the code :</p>
  
  <pre><code>var ciContext = CIContext(options: nil)
  var beginImage = CIImage(image: imageView.image)
  var filter = CIFilter(name: "CIPerspectiveTransform")
  
  filter.setValue(CIVector(x: 200, y: 400), forKey: "inputTopLeft")
  filter.setValue(CIVector(x: 300, y: 500), forKey: "inputTopRight")
  filter.setValue(CIVector(x: 100, y: 100), forKey: "inputBottomLeft")
  filter.setValue(CIVector(x: 400, y: 200), forKey: "inputBottomRight")
  
  filter.setValue(beginImage, forKey: kCIInputImageKey)
  var filteredImageData = filter.valueForKey(kCIOutputImageKey) as CIImage
  var filteredImageRef = ciContext.createCGImage(filteredImageData, fromRect: filteredImageData.extent())
  var filteredImage = UIImage(CGImage: filteredImageRef)
  self.imageView.image = filteredImage
  </code></pre>
  
  <p>want to try <code>CATransform3d</code> but don't know how to use it.. :)</p>
  
  <p>anyone can help me?</p>
  
  <p>thank you.</p>