How to solve this issue in iOS 13? I am taking screenshot of UITextView content size..Till iOS 12 everything is working fine. But issue with iOS 13 onwards it\'s not taking
Don't draw the layer, use the attributedText instead
let size = self.textView.contentSize
UIGraphicsBeginImageContextWithOptions(size, self.textView.isOpaque, 0)
//the textView has 8 margin
textView.attributedText.draw(in: CGRect.init(x: 0, y: 0, width: size.width - 16, height: size.height))
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()