I have a UITableView
which is populated with some data but since it contains data that is more cells than the viewable area of the screen, I only managed to get onl
Based on Vin's answer (also can be used for snapshotting UIScrollViews):
UIGraphicsBeginPDFContextToData(pdfData, CGRectMakeWithSize(0, 0, self.productsTable.contentSize), nil);
UIGraphicsBeginPDFPage();
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
[self.productsTable scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];
[self.productsTable.layer renderInContext:UIGraphicsGetCurrentContext()];
CGFloat screensInTable = self.productsTable.contentSize.height / self.productsTable.height;
for (int i = 1; i < screensInTable; i++) {
CGPoint contentOffset = CGPointMake(0, i * self.productsTable.height);
[self.productsTable setContentOffset:contentOffset animated:NO];
[self.productsTable.layer renderInContext:UIGraphicsGetCurrentContext()];
}
UIGraphicsEndPDFContext();