title: How to resize and rotate the image view by dragging it right corner of the image view
body: <p>Hi I have a requirement where i need to resize and rotate the image view by dragging it right corner of the image view.</p>
  
  <p>I could successfully resize the image view by dragging its corner, but failed when i am trying to implement the resize cum rotate feature for the image view with one-finger.</p>
  
  <p>Can any one please guide me to achieve my requirement.</p>
  
  <p>I have added the code below for resizing the image view from its corner edge.</p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
  UITouch *touch = [[event allTouches] anyObject];
  touchStart = [[touches anyObject] locationInView:self];
  isResizingLR = (self.bounds.size.width - touchStart.x &lt; kResizeThumbSize &amp;&amp; self.bounds.size.height - touchStart.y &lt; kResizeThumbSize);
  isResizingUL = (touchStart.x &lt;kResizeThumbSize &amp;&amp; touchStart.y &lt;kResizeThumbSize);
  isResizingUR = (self.bounds.size.width-touchStart.x &lt; kResizeThumbSize &amp;&amp; touchStart.y&lt;kResizeThumbSize);
  isResizingLL = (touchStart.x &lt;kResizeThumbSize &amp;&amp; self.bounds.size.height -touchStart.y &lt;kResizeThumbSize);
  </code></pre>
  
  <p>}</p>
  
  <pre><code>- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
  CGPoint touchPoint = [[touches anyObject] locationInView:self];
  CGPoint previous=[[touches anyObject]previousLocationInView:self];
  
  float  deltaWidth = touchPoint.x-previous.x;
  float  deltaHeight = touchPoint.y-previous.y;
  
  if (isResizingLR) {
      self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y,touchPoint.x + deltaWidth, touchPoint.y + deltaWidth);
  }  
  if (isResizingUL) {
      self.frame = CGRectMake(self.frame.origin.x + deltaWidth, self.frame.origin.y + deltaHeight, self.frame.size.width - deltaWidth, self.frame.size.height - deltaHeight);
  } 
  if (isResizingUR) {
      self.frame = CGRectMake(self.frame.origin.x ,self.frame.origin.y + deltaHeight,  self.frame.size.width + deltaWidth, self.frame.size.height - deltaHeight);      
  } 
  if (isResizingLL) {
      self.frame = CGRectMake(self.frame.origin.x + deltaWidth ,self.frame.origin.y ,  self.frame.size.width - deltaWidth, self.frame.size.height + deltaHeight);   
  }
  
  if (!isResizingUL &amp;&amp; !isResizingLR &amp;&amp; !isResizingUR &amp;&amp; !isResizingLL) {
      self.center = CGPointMake(self.center.x + touchPoint.x - touchStart.x,self.center.y + touchPoint.y - touchStart.y);
  }
  </code></pre>
  
  <p>} </p>