soffes/SAMGradientView — pull request #1 by bshakr (2013-07-11 22:38:23+00:00)
Title: Desature gradient when tintAdjustementMode == UIViewTintAdjustmentModeDimmed

Hi Sam,

First off, thank you so much for open sourcing so much stuff! I'm daily learning iOS development from reading your code. cheddar for ios source has been invaluable for me in learning iOS dev.

This is my first pull request ever! So please go easy on me.

I'm working on an iOS7 app and was using your gradient view and I noticed that it does not desaturate when a UIAlertView appears. I've read that every UIView now has a -(void)tintColorDidChange method that is called whenever desaturation needs to happen. This is also mentioned briefly in WWDC 2013 session 214.

I hope this code is good enough if not please let me know your comments. I've got one hack and I'm sure it's unnecessary but for some reason the view -(void)tintColorDidChange when it's first loaded which is weird. Maybe you can help me understand why that is happening. I've put a private boolean to work around this.

Hope you have a great day.

Cheers,
Bassem