Я делюсь контентом(скрин UILabel) в приложении через UIActivityController. Все работает кроме того что скриншот выходит кривой. Оно делает скрин не Label, а лезет в сторону и обрезает даже. Как я могу это исправить ?
Вот мой код контроллера.
@IBAction func shareContent(_ sender: UIButton) {
UIGraphicsBeginImageContext(someLabel.bounds.size)
view.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
var imagesToShare = [AnyObject]()
imagesToShare.append(image!)
let activityViewController = UIActivityViewController(activityItems: imagesToShare , applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
present(activityViewController, animated: true, completion: nil)
}