-1

I am Adding multiple CAShapeLayers to layer property of my UIView subclass by calling [self.layer addSublayer:shapeLayer];

To capture these layers in a UIImage I have implemented the following method which is meant to take an image of the layer property.

- (UIImage *)takeImage {

    UIGraphicsBeginImageContext(self.frame.size);

    CGContextRef context = UIGraphicsGetCurrentContext();

    if (context) {

        [self.layer renderInContext:context];

        UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();

        UIGraphicsEndImageContext();

        return snapshotImage;
    }

    return nil;
}

My Problem is, that the resulting image is completely blank. Why is this so?

regetskcob
  • 1,172
  • 1
  • 13
  • 35

1 Answers1

0

The image was great! Didn't set the IBOulet properly.

regetskcob
  • 1,172
  • 1
  • 13
  • 35