When I add the code:
image.layer.shadowColor = [[UIColor blackColor] CGColor];
image.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);
image.layer.shadowRadius = 3.0f;
image.layer.shadowOpacity = 1.0f;
and also import
<QuartzCore/CALayer.h>
and
<QuartzCore/QuartzCore.h>
I get an error for each of the mentioned lines starting with image.layer, satiating that: “Property ‘layer’ not found on object of type ‘UIImage *’
How can I fix this?
UIImage instance represents image data. UIImageView instances represent actual images in UI. UI objects have layer, not data objects, so you need to do what you are doing on an instance of UIImageView instead of UIImage.