- (CAGradientLayer*)gradientLayerOf:(CALayer*)layer{
for (CALayer *sublayer in layer.sublayers) {
if ([sublayer isKindOfClass:[CAGradientLayer class]]) {
return (CAGradientLayer*)sublayer;
}
}
return nil;
}