// // DRShareManager.m // YouHuiProject // // Created by 小花 on 2018/8/14. // Copyright © 2018年 kuxuan. All rights reserved. // #import "DRShareManager.h" @implementation DRShareManager + (void)shareImageWithplatformType:(UMSocialPlatformType)platformType withImg:(id)img complete:(void (^)(id result,NSError *error))complete{ //创建分享消息对象 UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject]; //创建图片内容对象 UMShareImageObject *shareObject = [[UMShareImageObject alloc] init]; //如果有缩略图,则设置缩略图 // shareObject.thumbImage = [UIImage imageNamed:@"share_appicon"]; [shareObject setShareImage:img]; //分享消息对象设置分享内容对象 messageObject.shareObject = shareObject; [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:nil completion:^(id data, NSError *error) { if (complete) { complete(data,error); } }]; } @end