Skip to content

Instantly share code, notes, and snippets.

@nataliepo
Created May 2, 2014 22:23
Show Gist options
  • Save nataliepo/73a5c5be0616b1d09115 to your computer and use it in GitHub Desktop.
Save nataliepo/73a5c5be0616b1d09115 to your computer and use it in GitHub Desktop.
repeated
-(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