线程(英语:thread)是操作系统能够进行运算调度的最小单位。
进程(英语:process),是计算机中已运行程序的实体/进程是具有独立功能的程序在一个数据集合上运行的过程,它是系统进行资源分配和调度的一个独立单位。
进程:更好的描述和控制程序的并发执行,实现操作系统的并发性和共享性。 线程:减少程序在并发执行是所付出的时空开销,提高操作系统的并发性能。
+ (instancetype)imageWithLightImageBlock:(UIImage *(^)(void))lightImageBlock | |
darkImageBlock:(UIImage *(^)(void))darkImageBlock | |
{ | |
__block UIImage *image = nil; | |
if (@available(iOS 13.0, *)) { | |
UITraitCollection *const scaleTraitCollection = [UITraitCollection currentTraitCollection]; | |
UITraitCollection *const lightUnscaledTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]; |
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |
-(float)compareString:(NSString *)originalString withString:(NSString *)comparisonString | |
{ | |
// Normalize strings | |
[originalString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
[comparisonString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
originalString = [originalString lowercaseString]; | |
comparisonString = [comparisonString lowercaseString]; | |
// Step 1 (Steps follow description at http://www.merriampark.com/ld.htm) |