I'm developing an iOS application where a user can add as many texts and images as possible (just like typing and adding emojis on the iPhone textview) to a UITextView
.
Is there any way to take a snapshot to cover the scrolled items. I need to post whatever the user has added into the UITextView
to his/her Facebook wall. At the moment, the snapshot only captures what is visible on the screen. I'm using Swift.
The Code:
UIGraphicsBeginImageContextWithOptions(message.contentSize, false, 0);
message.layer.renderInContext(UIGraphicsGetCurrentContext());
let img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();