title: How to create a CGGradient for my UIView subclass?
body: <p>Does anyone know how to create a <strong>CGGradient</strong> that will fill my view,<br>
  my current code is this and it fill the <strong>UIView</strong> with a red rectangle I want to have a <strong>gradient</strong> (from black to grey for instance) instead of the rect : </p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
      CGContextRef context=UIGraphicsGetCurrentContext();
      CGRect r;
      r.origin.x=0.;
      r.origin.y=0.;
      r.size.width=rect.size.width;   
      r.size.height=rect.size.height; 
      CGContextSetRGBFillColor(context, 1., 0., 0., 1.);
      CGContextFillRect (context,r);  
  }
  </code></pre>