Created
June 7, 2023 20:01
-
-
Save IslamRustamov/aedc2622cacc2047df59afd448fb30cb 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
- (void)sort:(NSMutableArray *)arr resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject { | |
NSMutableArray <NSNumber *>*foo = [[NSMutableArray alloc] initWithArray:arr copyItems:YES]; | |
for (int i = 0; i < [foo count]; i++) { | |
for (int j = 0; j < [foo count] - 1; j++) { | |
if (foo[j + 1].integerValue < foo[j].integerValue) { | |
NSInteger a = foo[j].integerValue; | |
foo[j] = foo[j + 1]; | |
foo[j + 1] = @(a); | |
} | |
} | |
} | |
resolve(foo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment