Skip to content

Instantly share code, notes, and snippets.

View qyzhaojinxi's full-sized avatar
🎯
Focusing

EricZhao qyzhaojinxi

🎯
Focusing
  • 北京
View GitHub Profile
@qyzhaojinxi
qyzhaojinxi / 常用工具和插件
Last active February 20, 2017 06:23
常用工具和插件 #工具 #xcode插件 #软件 #chrome插件
xcode插件:
Alcatraz 管理第三方插件
cocoapods-xcode-plugin
FuzzyAutocompletePlugin-master
KSImageNamed-Xcode-master
@qyzhaojinxi
qyzhaojinxi / 最新一张照片.m
Last active December 10, 2015 19:00
最新一张照片 #获取最新照片 #最后照片
- (void)showLastImageForImageView:(UIImageView *)imageView
{
ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror){
NSLog(@"相册访问失败 =%@", [myerror localizedDescription]);
if ([myerror.localizedDescription rangeOfString:@"Global denied access"].location!=NSNotFound) {
NSLog(@"无法访问相册.请在'设置->定位服务'设置为打开状态.");
}else{
NSLog(@"相册访问失败.");
@qyzhaojinxi
qyzhaojinxi / AppConfig.h
Last active December 10, 2015 19:00
AppConfig #ios开发app配置
#define VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
#define BUNDLEID [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define IS_IOS7 (BOOL)([[[UIDevice currentDevice] systemVersion]floatValue]>=7.0 ? YES : NO)
#define IS_IOS8 (BOOL)([[[UIDevice currentDevice] systemVersion]floatValue]>=8.0 ? YES : NO)
#define ApplicationDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)
#define WEAKSELF typeof(self) __weak weakSelf = self;
@qyzhaojinxi
qyzhaojinxi / 图片水印.m
Last active December 10, 2015 18:58
图片水印 #截屏 #图片加文字 #图片加水印
截屏
UIGraphicsBeginImageContextWithOptions(pageView.page.bounds.size, YES, zoomScale);
[pageView.page.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *uiImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
图片加文字
-(UIImage *)addText:(UIImage *)img text:(NSString *)text1
{
//上下文的大小