Last active
December 12, 2015 09:39
-
-
Save rpitting/4753669 to your computer and use it in GitHub Desktop.
Well, I really did not notice this really slooooooooooow fadeout of my *beautiful* scrollview shadows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) fadeOutShadowsSuchThatReinerWontNotice | |
{ | |
NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss zzz"]; | |
NSDate *fadeOutStartDate = [df dateFromString:@"2013-01-21 15:00:00 +0100"]; | |
NSDate *fadeOutEndDate = [df dateFromString:@"2013-01-25 18:00:00 +0100"]; | |
NSDate *now = [NSDate date]; | |
float blendValue = (now.timeIntervalSince1970 - fadeOutStartDate.timeIntervalSince1970) / | |
(fadeOutEndDate.timeIntervalSince1970 - fadeOutStartDate.timeIntervalSince1970); | |
if (blendValue < 0) blendValue = 0; | |
if (blendValue > 1) blendValue = 1; | |
self.leftShadowView.alpha *= 1 - blendValue; | |
self.rightShadowView.alpha *= 1 - blendValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment