I have a code for drawing bounds to UICollectionViewCell. It works when I call it in "cellForItemAtIndexPath".
[cell.layer setBorderColor:[UIColor redColor].CGColor];
[cell.layer setBorderWidth:1.0f];
[cell.layer setCornerRadius:7.5f];
[cell.layer setShadowOffset:CGSizeMake(0, 1)];
[cell.layer setShadowColor:[UIColor whiteColor].CGColor];
[cell.layer setShadowRadius:8.0];
[cell.layer setShadowOpacity:0.8];
But what I want to do is implement this features in appDelegate so I don't have to implement all this code to various classes.
[[[UICollectionViewCell appearance] layer] setMasksToBounds:NO];
[[[UICollectionViewCell appearance] layer] setBorderColor:[UIColor redColor].CGColor];
[[[UICollectionViewCell appearance] layer] setBorderWidth:1.0f];
[[[UICollectionViewCell appearance] layer] setCornerRadius:7.5f];
[[[UICollectionViewCell appearance] layer] setShadowOffset:CGSizeMake(0, 1)];
[[[UICollectionViewCell appearance] layer] setShadowColor:[UIColor whiteColor].CGColor];
[[[UICollectionViewCell appearance] layer] setShadowRadius:8.0];
[[[UICollectionViewCell appearance] layer] setShadowOpacity:0.8];
When I use above code in appDelegate it doesn't work. Any suggestion??
I also import <QuartzCore/QuartzCore.h>
None of those properties (the CALayer properties) supported the appearance proxy.
Have a look at this list for all the properties that can be styled using the appearance proxy.