3 つの異なる PDF ファイルを読み込んで乾燥させ、drawLayer を使用してそれらを 3 つの UIview に描画しています。これは機能しますが、3 つすべてが 1 つの UIview の同じレイヤーに描画されます。それぞれ独自の UIView に描画する必要がありますが、このコードを 3 つの部分に解析する方法がわかりません。アイデアはありますか?
// This method takes care of the cropping and adds each PDF layer to the view
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context {
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(context, CGContextGetClipBoundingBox(context));
CGContextTranslateCTM(context, 0.0, layer.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(mappageRef, kCGPDFCropBox, layer.bounds, 0, true));
CGContextDrawPDFPage(context, mappageRef);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(vorpageRef, kCGPDFCropBox, layer.bounds, 0, true));
CGContextDrawPDFPage(context, vorpageRef);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(labelpageRef, kCGPDFCropBox, layer.bounds, 0, true));
CGContextDrawPDFPage(context, labelpageRef);
}