title: Right way to transform the uibutton
body: <p>When I made the transfrom UIButton background image showed ragged side</p>
  
  <p><img src="https://i.stack.imgur.com/Ii2IY.jpg" alt="enter image description here"></p>
  
  <p>My code is here:</p>
  
  <pre><code>int r = arc4random() % 20 - 10;
  avatarImgBtn.transform = CGAffineTransformMakeRotation(degreesToRadian(r));
  titleImgBtn.transform = CGAffineTransformMakeRotation(degreesToRadian(r));
  title.transform = CGAffineTransformMakeRotation(degreesToRadian(r));
  
  avatarImgBtn.layer.borderWidth = 3;
  avatarImgBtn.layer.borderColor = [UIColor clearColor].CGColor;
  avatarImgBtn.layer.shouldRasterize = YES;
  </code></pre>
  
  <p><p> How can I do the right. Please help me. Thanks in advance!!!</p>