Trying to use CGContextSetShadow with CGContext(Begin/End)TransparencyLayer does not result in a shadow.
The shapes drawn in the transparency layer should have a unified shadow, as if the shapes were one whole shape with a shadow.
No shadow is drawn at all.
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat maxWidth = rect.size.width;
CGFloat maxHeight = rect.size.height;
// White background
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextFillRect(context, CGRectMake(0, 0, maxWidth, maxHeight));
// Rect Size
CGFloat rectWidth = maxWidth / 2.0;
CGFloat rectHeight = rectWidth;
// Enable shadow
CGSize shadowOffset = CGSizeMake(10, 20);
CGContextSetShadow(context, shadowOffset, 10);
// Begin Transparency
CGContextBeginTransparencyLayer(context, NULL);
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextFillRect(context, CGRectMake(rectWidth / 2 + 25, maxHeight / 2 - rectHeight / 2 - 50, rectWidth, rectHeight));
CGContextSetFillColorWithColor(context, [UIColor greenColor].CGColor);
CGContextFillRect(context, CGRectMake(rectWidth / 2 - 25, maxHeight / 2 - rectHeight / 2 + 25, rectWidth, rectHeight));
CGContextSetFillColorWithColor(context, [UIColor blueColor].CGColor);
CGContextFillRect(context, CGRectMake(rectWidth / 2 - 50, maxHeight / 2 - rectHeight / 2, rectWidth, rectHeight));
// End Transparency
CGContextEndTransparencyLayer(context);
Issue Description
Trying to use CGContextSetShadow with CGContext(Begin/End)TransparencyLayer does not result in a shadow.
Reproduction Steps
Expected Behavior
The shapes drawn in the transparency layer should have a unified shadow, as if the shapes were one whole shape with a shadow.
Observed Behavior
No shadow is drawn at all.
Pull Request, Test Case, or Sample Code
See this URL for how Apple expects it to work.