title: iPhone image stretching (skew)
body: <p>How do I skew an image? For example, each corner has a CGPoint with coords - p1, p2, p3, p4. Then, I need to set - p4.x+=50, p4.y+=30. So this corner (p4) should be stretched in a 2D perspective and the image should be distorted.</p>
  
  <p><a href="https://i.stack.imgur.com/qB1H7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qB1H7.png" alt="alt text"></a><br>
  <sub>(source: <a href="http://www.polar-b.com/scew.png" rel="nofollow noreferrer">polar-b.com</a>)</sub>  </p>
  
  <p>I tried to use <strong>CATransform3D</strong>, but it seems that this cannot be done in such way, since it's only a change the perspective of view (rotate, bring closer/farther one side). Maybe <strong>CGAffineTransform</strong> can be useful? </p>
  
  <p>If you know the answer, please write a sample code.</p>
  
  <p>Thanks in advance</p>