I am working on the SWReveal view controller content view as gradient layer. I tried to set the content layer as gradient layer but it is not working. And i write code in SWReveal view controller.m file and the method is - (void)loadView.
Here my code is.
self.gradientLayer.frame = _contentView.bounds;
self.color1 = ((UIColor*)[UIColor colorWithRed:(3.0/255.f) green: (185.0/255.f) blue:(173.0/255.f) alpha:1.0f]);
self.color2 = ((UIColor*)[UIColor colorWithRed:(0.0/255.f) green:(172.0/255.f) blue:(220.0/255.f) alpha:1.0f]);
self.gradientLayer.colors = [NSArray arrayWithObjects:(id)self.color1.CGColor, (id)self.color2.CGColor, nil];
self.gradientLayer.locations = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f], [NSNumber numberWithFloat:1.0], nil];
[_contentView.layer insertSublayer:self.gradientLayer atIndex:0];
Can any one help me to solve this problem. Thanks in advance.