ios 屏幕截图- 延迟执行

 

- (IBAction)clip {
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        // 1.捕捉
        UIImage *newImage = [UIImage captureWithView:self.view];
        
        // 2.写文件
        NSData *data = UIImagePNGRepresentation(newImage);
        NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"new.png"];
        [data writeToFile:path atomically:YES];
    });
}

ios 屏幕截图- 延迟执行

上一篇:thinkphp学习笔记8—命名空间


下一篇:php.ini配置