I have a custom UITableViewCell with a custom layout. I wanted a gradient background, so in my UITableViewDelegate cellForRowAtIndexPath: method, I create a CAGradientLayer
I know this thread is old, but here's a solution for the first part of your question (adding a gradient to the selected and non-selected states of a cell):
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell setBackgroundColor:[UIColor clearColor]];
CAGradientLayer *grad = [CAGradientLayer layer];
grad.frame = cell.bounds;
grad.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor], (id)[[UIColor blackColor] CGColor], nil];
[cell setBackgroundView:[[UIView alloc] init]];
[cell.backgroundView.layer insertSublayer:grad atIndex:0];
CAGradientLayer *selectedGrad = [CAGradientLayer layer];
selectedGrad.frame = cell.bounds;
selectedGrad.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor whiteColor] CGColor], nil];
[cell setSelectedBackgroundView:[[UIView alloc] init]];
[cell.selectedBackgroundView.layer insertSublayer:selectedGrad atIndex:0];
}