Skip to content

Instantly share code, notes, and snippets.

@jessesquires
Last active August 29, 2015 14:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
sorts
// Swift
var arr: [Int] = // some array
let newArr = sorted(arr);
// Objective-C
NSMutableArray *arr = // some array
[arr sortUsingComparator:^NSComparisonResult(NSNumber *n1, NSNumber *n2) {
return [n1 compare:n2];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment