I searched SO and tried many given solutions but in vain, am developing an app in which i need to take a screenshot, i have a UIViewController and a scrollview, In the scrollview i have some labels and at the bottom of the screen i have a button, which is visible when i scroll to the bottom.
When i click the button which is at the bottom of the screen, i want to capture all of the screen from top to bottom, but the problem i am facing is, its not scrolling to the top, i am getting only the visible area of the screen in the screenshot, as seen in this image: I am using below code, Thanks in advance
//Create the UIImage
UIGraphicsBeginImageContext(view.bounds.size) //view.frame.size
view.layer.renderInContext(UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
sharedImage = image