Skip to content

Instantly share code, notes, and snippets.

@PrideChung
Last active December 19, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrideChung/5890314 to your computer and use it in GitHub Desktop.
Save PrideChung/5890314 to your computer and use it in GitHub Desktop.
CAGradientLayer boilerplate code.
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = cell.backgroundView.frame;
UIColor* lightColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
UIColor* darkColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
gradient.colors = @[(id)darkColor.CGColor, (id)lightColor.CGColor];
gradient.locations = @[@0.0, @1.0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment