add
This commit is contained in:
@@ -16,5 +16,6 @@
|
||||
-(void)removeItemAtPath:(NSString *)filePath;
|
||||
- (void)saveAdImageWithUrl:(NSString *)imageUrl imageName:(NSString *)imageName success:(void (^)(void))success
|
||||
failure:(void (^)(NSError *err))failure;
|
||||
-(void)saveImaeToAlBum:(UIImage *)image;
|
||||
|
||||
@end
|
||||
|
||||
@@ -64,5 +64,27 @@
|
||||
} });
|
||||
}
|
||||
|
||||
-(void)saveImaeToAlBum:(UIImage *)image{
|
||||
if (image != nil) {
|
||||
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)image: (UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
|
||||
|
||||
NSString *msg = nil ;
|
||||
|
||||
if(error != NULL){
|
||||
|
||||
msg = @"保存图片失败" ;
|
||||
|
||||
}else{
|
||||
|
||||
msg = @"保存图片成功,可到相册查看" ;
|
||||
|
||||
}
|
||||
[[UIApplication sharedApplication].keyWindow makeToast:msg duration:1.6 position:CSToastPositionCenter];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+6
-4
@@ -1,18 +1,20 @@
|
||||
//
|
||||
// GIGaFileManager.h
|
||||
// GIGaUserFileHelper.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/18.
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface GIGaFileManager : NSObject
|
||||
@interface GIGaUserFileHelper : NSObject
|
||||
|
||||
+(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image;
|
||||
+(UIImage *)getUserAvatorWith:(NSString *)userId;
|
||||
+ (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size;
|
||||
+ (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
+4
-7
@@ -1,16 +1,14 @@
|
||||
|
||||
//
|
||||
// GIGaFileManager.m
|
||||
// GIGaUserFileHelper.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/18.
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GIGaFileManager.h"
|
||||
|
||||
@implementation GIGaFileManager
|
||||
#import "GIGaUserFileHelper.h"
|
||||
|
||||
@implementation GIGaUserFileHelper
|
||||
+(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image{
|
||||
if (!userId) {
|
||||
GILog(@"userID nil !!!");
|
||||
@@ -83,5 +81,4 @@
|
||||
return newimage;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user