前言:
有時間就屢屢單利設(shè)計思路撮躁,寫個簡單的封裝漱病,練習(xí)一下代碼买雾,看看能用就拿去用,如果有問題杨帽,還望大家指正漓穿。
如圖:
-
圖一是普通分享樣式
-
監(jiān)控截屏分享,并添加二維碼烙印
用法:
注:截屏監(jiān)控請?zhí)砑?/p>
//截屏
[[ToolscreenShot screenShot] addScreenShotNotification];
[GShareView newShare].shareType = ShareViewType;
[[GShareView newShare] show];
[GShareView newShare].shareBlock = ^(ShareClickType shareClickType) {
NSString * title;
switch (shareClickType) {
case QQ_ShareType:
NSLog(@"QQ好友");
title = @"分享到QQ";
break;
case error_ShareType:
NSLog(@"失敗");
title = @"分享失敗";
break;
case Qzone_ShareType:
NSLog(@"QQ空間");
title = @"分享到QQ空間";
break;
case WechatTimeLine_ShareType:
NSLog(@"微信朋友圈");
title = @"分享到微信朋友圈";
break;
case WechatSession_ShareType:
NSLog(@"微信好友");
title = @"分享到微信好友";
break;
case Sina_ShareType:
NSLog(@"新浪微博");
title = @"分享到新浪微博";
break;
default:
break;
}
GSLAlertView * alertGs = [[GSLAlertView alloc] initWithTitle:@"提示" message:title sureBtn:@"知道了" cancleBtn:nil];
alertGs.resultIndex = ^(NSInteger index) {
};
[alertGs showGSAlertView];
};
dome下載地址:ShareDome