I've been working on an app where I have a UIView that needs to be printed via AirPrint. To accomplish this I first fill out all the details in the view and then pass it to the below code to make a pdf out of before printing it. In Xcode 7 everything was working fine. Since I did the update to Xcode 8, the view doesn't render to the correct size any more using renderInContext.
- (NSMutableData *)createPDFDataFromUIView:(UIView *)aView {
NSMutableData *pdfDataObject=[NSMutableData data];
UIGraphicsBeginPDFContextToData(pdfDataObject, [aView bounds], nil);
UIGraphicsBeginPDFPage();
CGContextRef pdfContext= UIGraphicsGetCurrentContext();
[[aView layer] renderInContext:pdfContext];
UIGraphicsEndPDFContext();
return pdfDataObject;
}Any help would be appreciated.