#import <Foundation/Foundation.h>
#import "NDShareModel.h"
typedef NS_ENUM(NSInteger, SharePlace)
{
SharePlaceChaep,
SharePlaceUserNorHome,
SharePlaceUserKolHome,
SharePlaceKolHome,
SharePlaceTopicl,
SharePlaceGoods,
SharePlacePay,
SharePlaceCoupe
};
typedef NS_ENUM(NSInteger, ShareContentType){
ShareContentTypeText,
ShareContentTypeImage,
ShareContentTypeApp,
ShareContentTypeImageAndText
};
@protocol NDShareUmMangerDelegate<NSObject>
@optional
-(void)selectedSharePlatform;
-(void)shareFinished;
@end
@interface NDShareUmManger : NSObject
@property(nonatomic,weak)id<NDShareUmMangerDelegate> shareDelegate;
@property(nonatomic,assign)SharePlace sharePlace;
+ (NDShareUmManger *) shareUmManage;
//系统分享
-(void)shareToUmWithWithController:(id)shareController andShareModel:(NDShareModel *)shareModel andShareSnsTypes:(NSArray *)typesArray;
//分享大图
-(void)shareToUmWithWithController:(id)shareController andShareImage:(UIImage *)shareImage andShareQQZoneTitle:(NSString *)shareQQZoneTitle andShareSnsTypes:(NSArray *)typesArray;
//单分享
-(void)shareToUmWithWithController:(id)shareController andPlatform:(NSString *)platform andSahreModel:(NDShareModel *)shareModel;
//分享大图
-(void)shareToUmWithController:(id)shareController andShareImage:(UIImage *)shareImage andShareQQZoneTitle:(NSString *)shareQQZoneTitle andPlatform:(NSString *)platform;
- (void)snsLoginToWeiboOnViewControlle:(UIViewController *)onViewController callback:(void (^)(id responseObject, NSError *error))snsLoginBack;
- (void)snsLoginToQQOnViewControlle:(UIViewController *)onViewController calback:(void (^)(id responseObject, NSError *error))snsLoginBack;
- (void)snsLoginToWechatOnViewControlle:(UIViewController *)onViewController callback:(void (^)(id responseObject, NSError *error))snsLoginBack;
@end
#import "NDShareUmManger.h"
#import "UMSocialDataService.h"
#import "UMSocial.h"
#import "WXApi.h"
#import "NDSNSModel.h"
@interface NDShareUmManger()
{
NDShareModel * _shareUmModel;
UIImage * _shareImage;
NSString * shareQZoneTitle;
UIViewController * shareUmController;
}
@property(nonatomic,assign)ShareContentType shareType;
@end
@implementation NDShareUmManger
+(NDShareUmManger *)shareUmManage
{
static NDShareUmManger * shareManger = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shareManger = [[self alloc]init];
});
return shareManger;
}
#pragma mark - 原生分享(文字加图片)
-(void)shareToUmWithWithController:(id)shareController andShareModel:(NDShareModel *)shareModel andShareSnsTypes:(NSArray *)typesArray
{
self.shareType = ShareContentTypeImageAndText;
_shareUmModel = shareModel;
shareUmController = shareController;
[UMSocialSnsService presentSnsIconSheetView:shareController appKey:UMeng_APIKey shareText:nil shareImage:nil shareToSnsNames:typesArray delegate:(id)self];
}
#pragma mark - 原生大图分享
-(void)shareToUmWithWithController:(id)shareController andShareImage:(UIImage *)shareImage andShareQQZoneTitle:(NSString *)shareQQZoneTitle andShareSnsTypes:(NSArray *)typesArray
{
self.shareType = ShareContentTypeImage;
_shareImage = shareImage;
shareQZoneTitle = shareQQZoneTitle;
shareUmController = shareController;
[UMSocialData defaultData].extConfig.wxMessageType = UMSocialWXMessageTypeImage;
[UMSocialData defaultData].extConfig.qqData.qqMessageType = UMSocialQQMessageTypeImage; //QQ空间不支持纯图片分享
[UMSocialSnsService presentSnsIconSheetView:shareController appKey:UMeng_APIKey shareText:nil shareImage:nil shareToSnsNames:typesArray delegate:(id)self];
}
#pragma mark - 自定义分享到某一开放平台(文字加图片)微信
-(void)shareToUmWithWithController:(id)shareController andPlatform:(NSString *)platform andSahreModel:(NDShareModel *)shareModel
{
self.shareType = ShareContentTypeImageAndText;
if([WXApi isWXAppInstalled])
{
_shareUmModel = shareModel;
shareUmController = shareController;
[[UMSocialControllerService defaultControllerService] setShareText:nil shareImage:nil socialUIDelegate:(id)self]; //设置分享内容和回调对象
[UMSocialSnsPlatformManager getSocialPlatformWithName:platform].snsClickHandler((id)self,[UMSocialControllerService defaultControllerService],YES);
}else
{
[self alterViewWithStr:@"您还未安装微信"];
}
}
#pragma mark - 仅分享图片(微信,QQ)
-(void)shareToUmWithController:(id)shareController andShareImage:(UIImage *)shareImage andShareQQZoneTitle:(NSString *)shareQQZoneTitle andPlatform:(NSString *)platform
{
self.shareType = ShareContentTypeImage;
_shareImage = shareImage;
shareQZoneTitle = shareQQZoneTitle;
shareUmController = shareController;
[UMSocialData defaultData].extConfig.wxMessageType = UMSocialWXMessageTypeImage;
[UMSocialData defaultData].extConfig.qqData.qqMessageType = UMSocialQQMessageTypeImage; //QQ空间不支持纯图片分享
[[UMSocialControllerService defaultControllerService] setShareText:nil shareImage:nil socialUIDelegate:(id)self]; //设置分享内容和回调对象
[UMSocialSnsPlatformManager getSocialPlatformWithName:platform].snsClickHandler((id)self,[UMSocialControllerService defaultControllerService],YES);
}
#pragma mark - um Delegate
//下面可以设置根据点击不同的分享平台,设置不同的分享文字
-(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocialData *)socialData
{
if (self.shareDelegate && [self.shareDelegate respondsToSelector:@selector(selectedSharePlatform)]) {
[self.shareDelegate selectedSharePlatform];
}
// [UMSocialConfig setFinishToastIsHidden:NO position:UMSocialiToastPositionCenter];
if (self.shareType == ShareContentTypeImageAndText) {
socialData.extConfig.wechatSessionData.url = _shareUmModel.shareUrl; //微信好友
socialData.extConfig.wechatTimelineData.url = _shareUmModel.shareUrl; //朋友圈
socialData.extConfig.qqData.url = _shareUmModel.shareUrl; //QQ好友
socialData.extConfig.qzoneData.url = _shareUmModel.shareUrl; //QQ空间
//分享图片
socialData.shareImage = _shareUmModel.shareImage;
if ([platformName isEqualToString:UMShareToWechatTimeline]||[platformName isEqualToString:UMShareToQzone]) { //朋友圈 qq空间
socialData.extConfig.title = _shareUmModel.shareTitle;
}else if([platformName isEqualToString:UMShareToSina])
{
socialData.shareText = [NSString stringWithFormat:@"%@, %@, %@",_shareUmModel.shareTitle,_shareUmModel.shareContent,_shareUmModel.shareUrl];
}else
{
//标题,用于指定微信分享标题,qzone分享的标题和邮件分享的标题。
socialData.extConfig.title =_shareUmModel.shareTitle;
socialData.shareText = _shareUmModel.shareContent;
}
}else if(self.shareType == ShareContentTypeImage)
{
if ([platformName isEqualToString:UMShareToQzone]) { //朋友圈 qq空间
socialData.extConfig.title = shareQZoneTitle;;
}
socialData.shareImage = _shareImage;
}
}
//下面得到分享完成的回调
-(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response
{
NSLog(@"didFinishGetUMSocialDataInViewController with response is %@",response);
if(response.responseCode == UMSResponseCodeSuccess)
{
if (self.shareDelegate && [self.shareDelegate respondsToSelector:@selector(shareFinished)]) {
[self.shareDelegate shareFinished];
}
// [self alterViewWithStr:@"分享成功"];
}
}
-(void)alterViewWithStr:(NSString *)str
{
UILabel * alterLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth/2-55, ScreenHeight/2-15, 110, 30)];
alterLabel.textAlignment = NSTextAlignmentCenter;
[shareUmController.view addSubview:alterLabel];
alterLabel.text = str;
alterLabel.layer.cornerRadius = 10;
alterLabel.alpha = 0.7;
alterLabel.clipsToBounds = YES;
alterLabel.font = [UIFont systemFontOfSize:14.0f];
alterLabel.backgroundColor = [UIColor blackColor];
alterLabel.textColor = [UIColor whiteColor];
[UIView animateWithDuration:2.5f animations:^{
alterLabel.alpha = 0.0f;
}];
}
#pragma mark - 微博登陆
- (void)snsLoginToWeiboOnViewControlle:(UIViewController *)onViewController callback:(void (^)(id, NSError *))snsLoginBack
{
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina];
snsPlatform.loginClickHandler(onViewController,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
// 获取微博用户名、uid、token等
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToSina];
NDSNSModel *snsUser = [[NDSNSModel alloc] init];
snsUser.snsNickName = snsAccount.userName;
snsUser.snsID = snsAccount.usid;
snsUser.snsType = SNSWeiBo;
snsLoginBack(snsUser,nil);
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
}});
}
- (void)obtainWeiboUserInfo
{
//获取accestoken以及QQ用户信息,得到的数据在回调Block对象形参respone的data属性
[[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToSina completion:^(UMSocialResponseEntity *response){
NSLog(@"SnsInformation is %@",response.data);
}];
}
#pragma mark - QQ登陆
- (void)snsLoginToQQOnViewControlle:(UIViewController *)onViewController calback:(void (^)(id responseObject, NSError * error))snsLoginBack
{
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToQQ];
snsPlatform.loginClickHandler(onViewController,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
// 获取微博用户名、uid、token等
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToQQ];
NDSNSModel *snsUser = [[NDSNSModel alloc] init];
snsUser.snsNickName = snsAccount.userName;
snsUser.snsID = snsAccount.usid;
snsUser.snsType = SNSQQ;
snsLoginBack(snsUser,nil);
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
}});
}
- (void)obtainQQUserInfo
{
//获取accestoken以及QQ用户信息,得到的数据在回调Block对象形参respone的data属性
[[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToQQ completion:^(UMSocialResponseEntity *response){
NSLog(@"SnsInformation is %@",response.data);
}];
}
#pragma mark - 微信登陆
- (void)snsLoginToWechatOnViewControlle:(UIViewController *)onViewController callback:(void (^)(id responseObject , NSError * error))snsLoginBack
{
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToWechatSession];
snsPlatform.loginClickHandler(onViewController,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary]valueForKey:UMShareToWechatSession];
NDSNSModel *snsUser = [[NDSNSModel alloc] init];
snsUser.snsNickName = snsAccount.userName;
snsUser.snsID = snsAccount.usid;
snsUser.snsType = SNSWeChat;
snsLoginBack(snsUser,nil);
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
}
});
}
- (void)obtainWechatUserInfo
{
//得到的数据在回调Block对象形参respone的data属性
[[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToWechatSession completion:^(UMSocialResponseEntity *response){
NSLog(@"SnsInformation is %@",response.data);
}];
}
#pragma mark -
- (void)unbindingOauth
{
[[UMSocialDataService defaultDataService] requestUnOauthWithType:UMShareToSina completion:^(UMSocialResponseEntity *response){
NSLog(@"response is %@",response);
}];
}
@end
#import <UIKit/UIKit.h>
@protocol NDShareFeedViewDelegate<NSObject>
@optional
-(void)shareSinaFeedClick:(UIImage *)image;
@end
@interface NDShareFeedView : UIView
@property(nonatomic,weak)id<NDShareFeedViewDelegate>delegate;
@property(nonatomic,strong)UIImage * shareFeedImage;
@property(nonatomic,strong)NSString * shareQQTitle;
@property(nonatomic,strong)NSString * feedId;
@property(nonatomic,strong)UIViewController * controller;
-(instancetype)initWithFrame:(CGRect)frame shareController:(id)controller andIsDelete:(BOOL)isDelete;
@end
@interface NDShareItemView : UIView
@property(nonatomic,strong)UIButton * shareImageBtn;
@property(nonatomic,strong)UILabel * sharePlateLabel;
-(instancetype)initWithShareImage:(NSString *)imageName andShareTitle:(NSString*)shareTitle;
@end
const static float shareImageWH = 33;
#import "NDShareFeedView.h"
#import "UMSocial.h"
#import "UIButton+EnlargeEdge.h"
#import "NDShareUmManger.h"
#import "NDBaseUserModel.h"
@interface NDShareFeedView()<UIAlertViewDelegate,NDShareUmMangerDelegate>
{
UIAlertView * reportAlterView;
UIAlertView * deleteAlterView;
}
@end
@implementation NDShareFeedView
-(instancetype)initWithFrame:(CGRect)frame shareController:(id)controller andIsDelete:(BOOL)isDelete
{
self = [super initWithFrame:frame];
if (self) {
self.controller = controller;
CGFloat sizeScaleX = [DeviceManage deviceManage].widthScaleRatio;
CGFloat sizeScaleY = [DeviceManage deviceManage].heighScaleRatio;
UIView * backView = [[UIView alloc]init];
backView.alpha = 0.5;
backView.backgroundColor = kBackgroudGrayColor;
[self addSubview:backView];
[backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_top);
make.left.equalTo(self.mas_left);
make.size.mas_equalTo(CGSizeMake([DeviceManage deviceManage].screenWidth,CGRectGetHeight(frame)-183*sizeScaleY));
}];
backView.userInteractionEnabled = YES;
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dealTap)];
[backView addGestureRecognizer:tap];
UIView * shareView = [[UIView alloc]init];
shareView.backgroundColor = [UIColor whiteColor];
[self addSubview:shareView];
[shareView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(backView.mas_bottom);
make.left.equalTo(self.mas_left);
make.size.mas_equalTo(CGSizeMake([DeviceManage deviceManage].screenWidth,183*sizeScaleY));
}];
UILabel * shareLabel = [[UILabel alloc]init];
shareLabel.font = [UIFont systemFontOfSize:12.0f];
shareLabel.textColor = kMainBlackColor;
shareLabel.text = @"分享到";
[shareView addSubview:shareLabel];
CGSize titleSize = [CustomSize returnSize:shareLabel.text fontSize:12.0f];
[shareLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(shareView.mas_top).offset(11*sizeScaleY);
make.left.equalTo(shareView.mas_left).offset(20*sizeScaleX);
make.size.mas_equalTo(CGSizeMake(titleSize.width, titleSize.height));
}];
UILabel * sepLabel = [[UILabel alloc]init];
sepLabel.backgroundColor = kSeparatorLineColor;
[shareView addSubview:sepLabel];
[sepLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(shareView.mas_top).offset(110*sizeScaleY);
make.left.equalTo(shareView.mas_left);
make.size.mas_equalTo(CGSizeMake([DeviceManage deviceManage].screenWidth, kSeparatorLineWidth));
}];
NSArray * shareBtnImageArray = @[@"goodsdetails_wechat_qq_bt",@"friends-circle",@"goodsdetails_share_qq_bt",@"goodsdetails_share_qq_bt",@"goodsdetails_share_weibo_bt",@"goodsdetails_share_weibo_bt",@"goodsdetails_share_weibo_bt"];
NSArray * shareTitleArray = @[@"微信",@"朋友圈",@"QQ",@"Qzone",@"微博",@"举报",@"删除"];
CGFloat itemWidth = [DeviceManage deviceManage].screenWidth/4 ;
CGFloat itemHieght = 61*sizeScaleY;
for (int i = 0; i<6; i++) {
NDShareItemView * itemView;
if (i<=4) {
itemView = [[NDShareItemView alloc]initWithShareImage:shareBtnImageArray[i] andShareTitle:shareTitleArray[i]];
[shareView addSubview:itemView];
if (i<=3) {
[itemView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(shareLabel.mas_bottom).offset(17*sizeScaleY);
make.left.equalTo(shareView.mas_left).offset(itemWidth*i);
make.size.mas_equalTo(CGSizeMake(itemWidth, itemHieght));
}];
}else
{
[itemView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(sepLabel.mas_bottom).offset(17*sizeScaleY);
make.left.equalTo(shareView.mas_left).offset(itemWidth*(i-4));
make.size.mas_equalTo(CGSizeMake(itemWidth, itemHieght));
}];
}
itemView.shareImageBtn.tag = i;
}else
{
if (isDelete) {
itemView = [[NDShareItemView alloc]initWithShareImage:shareBtnImageArray[i+1] andShareTitle:shareTitleArray[i+1]];
itemView.shareImageBtn.tag = i+1;
}else
{
itemView = [[NDShareItemView alloc]initWithShareImage:shareBtnImageArray[i] andShareTitle:shareTitleArray[i]];
itemView.shareImageBtn.tag = i;
}
[shareView addSubview:itemView];
[itemView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(sepLabel.mas_bottom).offset(17*sizeScaleY);
make.left.equalTo(shareView.mas_left).offset(itemWidth*(i-4));
make.size.mas_equalTo(CGSizeMake(itemWidth, itemHieght));
}];
}
[itemView.shareImageBtn addTarget:self action:@selector(tapShare:) forControlEvents:UIControlEventTouchUpInside];
}
}
return self;
}
#pragma mark - action
-(void)dealTap
{
[self removeFromSuperview];
}
-(void)tapShare:(UIButton *)btn{
[NDShareUmManger shareUmManage].shareDelegate = self;
switch (btn.tag) {
case 0:
[[NDShareUmManger shareUmManage]shareToUmWithController:self.controller andShareImage:self.shareFeedImage andShareQQZoneTitle:@"" andPlatform:UMShareToWechatSession];
break;
case 1:
[[NDShareUmManger shareUmManage]shareToUmWithController:self.controller andShareImage:self.shareFeedImage andShareQQZoneTitle:@"" andPlatform:UMShareToWechatTimeline];
break;
case 2:
[[NDShareUmManger shareUmManage]shareToUmWithController:self.controller andShareImage:self.shareFeedImage andShareQQZoneTitle:@"" andPlatform:UMShareToQQ];
break;
case 3:
[[NDShareUmManger shareUmManage]shareToUmWithController:self.controller andShareImage:self.shareFeedImage andShareQQZoneTitle:self.shareQQTitle andPlatform:UMShareToQzone];
break;
case 4:
[self.delegate shareSinaFeedClick:self.shareFeedImage];
break;
case 5:
{
reportAlterView = [[UIAlertView alloc] initWithTitle:@"是否举报?" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[reportAlterView setAlertViewStyle:UIAlertViewStylePlainTextInput];
[reportAlterView show];
}
break;
case 6:
{
deleteAlterView = [[UIAlertView alloc] initWithTitle:@"是否删除?" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[deleteAlterView show];
}
break;
default:
break;
}
}
#pragma mark - alterViewDelegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
if (alertView == reportAlterView) {
UITextField *tf=[alertView textFieldAtIndex:0];//获得输入框
NSString * text=tf.text;//获得值
[[NDHttpRequestManage requestManage]reportId:self.feedId withUserId:[NDBaseUserModel new].userID withContent:text complete:^(id completeObject, NSError *error) {
[self removeFromSuperview];
if (error == nil) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"举报成功" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alertView show];
[self performSelector:@selector(dimissAlertView:) withObject:alertView afterDelay:3.0f];
}
}];
}else if (alertView == deleteAlterView)
{
[[NDHttpRequestManage requestManage] deleteFeed:self.feedId WithUserID:[NDBaseUserModel new].userID complete:^(id _Nullable completeObject, NSError * _Nullable error) {
[self removeFromSuperview];
if (error == nil) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"删除成功" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alertView show];
[self performSelector:@selector(dimissAlertView:) withObject:alertView afterDelay:3.0f];
}
}];
}
}
}
- (void)dimissAlertView:(UIAlertView *)alertView
{
[alertView dismissWithClickedButtonIndex:0 animated:YES];
}
#pragma mark - shareUMDelegate
-(void)shareFinished
{
//[self removeFromSuperview];
}
-(void)selectedSharePlatform
{
[self removeFromSuperview];
}
@end
@implementation NDShareItemView
-(instancetype)initWithShareImage:(NSString *)imageName andShareTitle:(NSString*)shareTitle;
{
self = [super init];
if (self) {
CGFloat sizeScaleX = [DeviceManage deviceManage].widthScaleRatio;
CGFloat sizeScaleY = [DeviceManage deviceManage].heighScaleRatio;
[self addSubview:self.shareImageBtn];
[self addSubview:self.sharePlateLabel];
self.sharePlateLabel.text = shareTitle;
[self.shareImageBtn setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
[self.shareImageBtn setEnlargeEdgeWithTop:10 right:20 bottom:20 left:20];
[self.shareImageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_top);
make.centerX.equalTo(self.mas_centerX);
make.size.mas_equalTo(CGSizeMake(shareImageWH*sizeScaleX, shareImageWH*sizeScaleX));
}];
CGSize titleSize = [CustomSize returnSize:shareTitle fontSize:12.0f];
[self.sharePlateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.shareImageBtn.mas_bottom).offset(5*sizeScaleY);
make.centerX.equalTo(self.shareImageBtn.mas_centerX);
make.size.mas_equalTo(CGSizeMake(titleSize.width, titleSize.height));
}];
}
return self;
}
-(UIButton *)shareImageBtn
{
if (_shareImageBtn == nil) {
_shareImageBtn = [[UIButton alloc]init];
}
return _shareImageBtn;
}
-(UILabel *)sharePlateLabel
{
if (_sharePlateLabel == nil) {
_sharePlateLabel = [[UILabel alloc]init];
_sharePlateLabel.font = [UIFont systemFontOfSize:12.0f];
_sharePlateLabel.textColor = kMainBlackColor;
}
return _sharePlateLabel;
}
@end