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 *path = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject; | |
NSString *filePath = [path stringByAppendingPathComponent:@"OralEvaluationCache"]; | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
if (![fileManager fileExistsAtPath:filePath]){ | |
[fileManager createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil]; | |
} | |
NSString *fileName = [NSString stringWithFormat:@"%llu.%@", tickCountOfCPU(), [recordPath pathExtension]]; | |
NSString *moveToPath = [filePath stringByAppendingPathComponent:fileName]; | |
NSError *moveError; |
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
// [self IGC_setupGradientLayerWithStartColor:HEXCOLOR(0xFFD64E) endColor:HEXCOLOR(0xFFB918)]; | |
// [self IGC_setupGradientLayerWithStartColor:HEXCOLOR(0xFFB674) endColor:HEXCOLOR(0xFF6D0D)]; | |
- (void)IGC_setupGradientLayerWithStartColor:(UIColor *)startColor endColor:(UIColor *)endColor{ | |
[self layoutIfNeeded]; | |
CAGradientLayer *gl = [CAGradientLayer layer]; | |
gl.frame = self.bounds; |
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)IGC_shakeAnimationForView:(UIView *)view { | |
CALayer *viewLayer = view.layer; | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; | |
[animation setFromValue:[NSValue valueWithCATransform3D:CATransform3DRotate(viewLayer.transform,-0.12,0.0,0.0,0.12)]]; | |
[animation setToValue:[NSValue valueWithCATransform3D:CATransform3DRotate(viewLayer.transform,0.12,0.0,0.0,0.12)]]; | |
[animation setAutoreverses:YES]; | |
[animation setDuration:0.2]; | |
[animation setRepeatCount:MAXFLOAT]; |
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
{ | |
[self insertSubview:self.pandaButton aboveSubview:self.collectionView]; | |
[self.pandaButton mas_makeConstraints:^(MASConstraintMaker *make) { | |
make.width.height.mas_equalTo(84); | |
make.right.equalTo(self); | |
make.bottom.equalTo(self).offset(-80); | |
}]; | |
// [self scrollViewWillBeginDecelerating:self.collectionView]; |
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
https://blog.csdn.net/fys_0801/article/details/80180924 | |
-(void)xx{ | |
// 创建队列 | |
dispatch_queue_t queue = dispatch_queue_create("com.download.task", DISPATCH_QUEUE_SERIAL); | |
NSString *str = @"https://www.****.com/***.jpg"; | |
//设置信号总量为1,保证只有一个进程执行 | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(1); |
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
https://blog.csdn.net/qq_36557133/article/details/81106027 | |
https://blog.csdn.net/MinggeQingchun/article/details/52583709 | |
https://cloud.tencent.com/developer/article/1332213 | |
在iOS开发中我们都会遇到界面搭建中UILabel文本的宽度和高度的不可预估带来的适配或者约束中的麻烦。 | |
如果使用sb进行界面布局,只要label不设置宽、高约束就会自适应。 | |
1.单行 |
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
@property (nonatomic, strong) UIView *dayTimerContainerView;//!< 存放倒计时天、小时的View | |
[self.bgScrollContentView addSubview:self.dayTimerContainerView]; | |
[self.dayTimerContainerView mas_makeConstraints:^(MASConstraintMaker *make) { | |
make.top.equalTo(self.bgScrollContentView).mas_offset(16); | |
make.height.mas_equalTo(37); | |
make.centerX.equalTo(self.bgScrollContentView); | |
}]; |
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
UIImagePickerController *picker = [[UIImagePickerController alloc] init]; | |
picker.delegate = self; | |
picker.sourceType = UIImagePickerControllerSourceTypeCamera; | |
picker.sourceType = UIImagePickerControllerSourceTypeCamera; | |
if (self.model.crop == 1) { | |
picker.allowsEditing = YES; | |
UIImageView *overLayImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 640)]; | |
overLayImg.image = [UIImage imageNamed:@"exerciseNote_icon"]; |
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)setName:(NSString *)name{ | |
objc_setAssociatedObject(self, @selector(name), name, OBJC_ASSOCIATION_COPY_NONATOMIC); | |
} | |
- (NSString *)name{ | |
// 隐式参数 | |
// _cmd == @selector(name) | |
return objc_getAssociatedObject(self, _cmd); | |
} |
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
#import "IGCUITabLayout.h" | |
@interface IGCUITabLayout() | |
@property (nonatomic, strong) NSArray *tabItemsArray; | |
@property (nonatomic, strong) UIScrollView *scrollView; | |
@end |