Skip to content

Instantly share code, notes, and snippets.

@seivan
Last active December 20, 2015 21:58
Show Gist options
  • Save seivan/6201583 to your computer and use it in GitHub Desktop.
Save seivan/6201583 to your computer and use it in GitHub Desktop.
NSMutableArray * setOfPlayerIds = @[].mutableCopy;
for(GKTurnBasedMatch * match in theMatches) {
[setOfPlayerIds addObjectsFromArray:match.SH_playerIdentifiers];
}
[setOfPlayerIds addObjectsFromArray:theFriends];
//Immutable
setOfPlayerIds = [theMatches SH_reduceValue:theFriends withBlock:^id(NSArray * memo, GKTurnBasedMatch * obj) {
return [memo arrayByAddingObjectsFromArray:obj.SH_playerIdentifiers];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment