Last active
December 20, 2015 21:58
-
-
Save seivan/6201583 to your computer and use it in GitHub Desktop.
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
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