Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Last active December 17, 2015 19:09
Show Gist options
  • Save ashfurrow/5658708 to your computer and use it in GitHub Desktop.
Save ashfurrow/5658708 to your computer and use it in GitHub Desktop.
ReactiveCocoa Find Max Value in Array
CGFloat max = [[numbersArray.rac_sequence foldLeftWithStart:@(FLT_MIN) combine:^id(id accumulator, id value) {
if (value == [NSNull null]) return accumulator;
if ([accumulator floatValue] < [value floatValue]) return value;
else return accumulator;
}] floatValue];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment