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
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES |
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)solution{ | |
NSArray *list = @[@"end", @"back", @"and", @"the", @"po", @"pu", @"lar", @"face"]; //populate with any list of strings here | |
NSString *inputStr = @"facebackandthethethefacebackpopularlarpopu"; //or input any string here | |
BOOL canBeFormed = [self checkForString:inputStr.mutableCopy inList:list]; | |
if (canBeFormed) { | |
NSLog(@"YES! %@ can be formed from the list.", inputStr); |
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
NSString *fileURL = @"https://s3-ap-southeast-1.amazonaws.com/haptikdev/test/Conversation.txt"; | |
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] | |
delegate:self | |
delegateQueue:nil]; | |
NSURLSessionDownloadTask *getFile = [session downloadTaskWithURL:[NSURL URLWithString:fileURL] | |
completionHandler:^(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error) { | |
NSError *extractErr = nil; |
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
dispatch_group_t group = dispatch_group_create(); | |
dispatch_group_enter(group); | |
[context performBlock:^{ | |
//block operations | |
dispatch_group_leave(group); | |
}]; | |
dispatch_group_wait(group, DISPATCH_TIME_FOREVER); |
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
xattr -d com.apple.quarantine /path/to/app/myMacApp.app |
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
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.[hm]" -print0 | xargs -0 wc -l |
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
- (UIColor *)getAverageColor:(UIImage *)image{ | |
CGSize size = {1, 1}; | |
UIGraphicsBeginImageContext(size); | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
CGContextSetInterpolationQuality(ctx, kCGInterpolationMedium); | |
[image drawInRect:(CGRect){.size = size} blendMode:kCGBlendModeCopy alpha:1]; | |
uint8_t *data = CGBitmapContextGetData(ctx); | |
UIColor *color = [UIColor colorWithRed:data[2] / 255.0f | |
green:data[1] / 255.0f |
NewerOlder