title: Render UILabel to UIImage in much higher resolution
body: <p>I am using below function to render a UILabel to UIImage</p>
  
  <pre><code>func labelToImage(_ label: UILabel) -&gt; UIImage {           
      UIGraphicsBeginImageContextWithOptions(CGSize(width: label.frame.size.width*10, height: label.frame.size.height*10), false, 0)
      guard let context = UIGraphicsGetCurrentContext() else { return UIImage() }
      defer { UIGraphicsEndImageContext() }
      label.layer.render(in: context)
      return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()
  }
  </code></pre>
  
  <p>But the resolution of the resultant image is too low for my needs and I need it about 10 times higher. I do not want to scale the resultant image as that will pixelate it.</p>
  
  <p>I want to scale the UILabel and then render it to image. I have tried <code>CGAffinTransform Scale</code> but that does not do anything.</p>