Skip to content

Instantly share code, notes, and snippets.

@abhimuralidharan
Created August 22, 2016 10:03
Show Gist options
  • Select an option

  • Save abhimuralidharan/ad2956d42699de0c9b8e4060dbccff29 to your computer and use it in GitHub Desktop.

Select an option

Save abhimuralidharan/ad2956d42699de0c9b8e4060dbccff29 to your computer and use it in GitHub Desktop.
CAGradientLayer *topGradientLayer = [CAGradientLayer layer];
topGradientLayer.colors = @[ (id)([UIColor blackColor].CGColor), (id)([UIColor clearColor].CGColor),(id)([UIColor clearColor].CGColor)];
topGradientLayer.locations=@[];
topGradientLayer.frame = _highlightedPosterImageView.bounds; // line it up with the layer it’s masking
[_highlightedPosterImageView.layer insertSublayer:topGradientLayer atIndex:0];//top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment