Created
May 2, 2014 22:23
-
-
Save nataliepo/73a5c5be0616b1d09115 to your computer and use it in GitHub Desktop.
repeated
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)setUpLogicCasesUsedRepeatedly { | |
_logicUsedRepeatedly = [[NSMutableArray alloc] init]; | |
__block HukkOrNotFeedbackMessageViewController *blockSelf = self; | |
//---- | |
// 1 Positive I | |
[_logicUsedRepeatedly addObject:^{ | |
if (blockSelf.lastAction > 0) { | |
[blockSelf showViewWithFade:blockSelf.positiveSmall | |
shouldHideAfterward:YES]; | |
return YES; | |
} | |
return NO; | |
}]; | |
//---- | |
// Every 30 Random (Negatives I-III & Encouragement) | |
[_logicUsedRepeatedly addObject:^{ | |
if ((blockSelf.totalCount % 30) == 0) { | |
NSArray * possibleViews = @[ | |
@"negativeI", | |
@"negativeII", | |
@"negativeIII", | |
@"negativeIV", | |
@"encouragement" | |
]; | |
int rand_num = rand() % [possibleViews count]; | |
[blockSelf showGenericViewWithFade:[possibleViews objectAtIndex:rand_num] | |
shouldHideAfterward:NO]; | |
return YES; | |
} | |
return NO; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment