All Projects → liugangios → Ifmshare

liugangios / Ifmshare

Licence: mit
IFMShare是一个iOS客户端应用内分享的界面、功能一体化解决方案,使用简单、优雅,界面和功能高度可定制化。分享功能直接调用iOS系统内预制分享功能,无需去各种繁杂的社会化分享平台注册账号、无需下载导入各种SDK,使用非常简单。

Labels

Projects that are alternatives of or similar to Ifmshare

cockpit-samba-manager
A Cockpit plugin to manage Samba shares and users.
Stars: ✭ 28 (-92.96%)
Mutual labels:  share
ShareIntentBuilder
Share Intent Builder - Android Library for the type-safe creation of Share Intents.
Stars: ✭ 45 (-88.69%)
Mutual labels:  share
Katana
🚀 a powerful, open-source screenshot utility for macOS
Stars: ✭ 270 (-32.16%)
Mutual labels:  share
sharethis-reactjs
Official ShareThis Social Media Sharing Buttons For React.js
Stars: ✭ 32 (-91.96%)
Mutual labels:  share
sharestapp
Sharestapp lets you to directly share an image/videos/reels post from Instagram to other apps and also allows to save.
Stars: ✭ 13 (-96.73%)
Mutual labels:  share
SocialSharer
最 Pure 的社会化分享按钮
Stars: ✭ 18 (-95.48%)
Mutual labels:  share
netflix-list-exporter
💫‎‎‎‏‏‎ An Extension to export your lists from Netflix to Clipboard area and share it with your friends.
Stars: ✭ 60 (-84.92%)
Mutual labels:  share
Share.js
一键分享到微博、QQ空间、QQ好友、微信、腾讯微博、豆瓣、Facebook、Twitter、Linkedin、Google+、点点等
Stars: ✭ 3,534 (+787.94%)
Mutual labels:  share
videojs-share
Share plugin for video.js
Stars: ✭ 24 (-93.97%)
Mutual labels:  share
Share ppt
🚗 我个人曾经做过的技术分享...
Stars: ✭ 3,805 (+856.03%)
Mutual labels:  share
iOS interviews
iOS Interviews - 史上最贴心 iOS 面试知识点分享!不只是 iOS !只为技术的执拗 !👍 全网火速更新中 🔥 期待你的讨论,期待你的 issue ! 🌟
Stars: ✭ 25 (-93.72%)
Mutual labels:  share
Valheim-ServerSideMap
This plugin completely moves the explored map and created pins to the server. As clients explore, they will send their explored areas to the server who will then distribute it to all connected clients. When a client joins, the server will synchronize the currently explored areas to the client. Pins are shared as well but default to false and nee…
Stars: ✭ 32 (-91.96%)
Mutual labels:  share
aboutmeinfo-telegram-bot
ℹ️ About Me Info Bot: Share your social media and links on Telegram
Stars: ✭ 20 (-94.97%)
Mutual labels:  share
Godot-Share
Simple share text and/or image module for Godot Engine (Android & iOS)
Stars: ✭ 58 (-85.43%)
Mutual labels:  share
Cordova qq
A Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc.
Stars: ✭ 294 (-26.13%)
Mutual labels:  share
OneClip
Share your clipboard with people nearby. No Setup, No Signup.
Stars: ✭ 45 (-88.69%)
Mutual labels:  share
qr
🔲 Generate QR Codes straight in your terminal!
Stars: ✭ 34 (-91.46%)
Mutual labels:  share
Wechat kit
flutter版微信登录/分享/支付
Stars: ✭ 347 (-12.81%)
Mutual labels:  share
Vue Goodshare
🍿 Vue.js component for social share. A simple way to share a link on the pages of your website in the most popular (and not so) social networks. Powered by goodshare.js project.
Stars: ✭ 345 (-13.32%)
Mutual labels:  share
Pigeon
💬 一个轻量化的留言板 / 记事本 / 社交系统 / 博客。人类的本质是……咕咕咕?
Stars: ✭ 262 (-34.17%)
Mutual labels:  share

IFMShare

IFMShare(Swift版)是一个iOS客户端应用内分享的界面、功能一体化解决方案,使用简单、优雅,界面和功能高度可定制化。分享功能直接调用iOS系统内预制分享功能,无需去各种繁杂的社会化分享平台注册账号、无需下载导入各种SDK,使用非常简单。

Demo展示

图片展示

图片展示

GIF展示

动图展示

使用

在项目中导入IFMShareView.h,执行以下代码即可

 IFMShareView *shareView = [[IFMShareView alloc] initWithItems:@[IFMPlatformNameSms,IFMPlatformNameEmail,IFMPlatformNameQQ,IFMPlatformNameWechat] itemSize:CGSizeMake(80,100) DisplayLine:YES];
 
 //设置分享内容
[shareView addText:@"分享测试"];
[shareView addURL:[NSURL URLWithString:@"http://www.baidu.com"]];
[shareView addImage:image];
    
[shareView showFromControlle:self];

介绍

IFMShare由三个类组成,IFMShareView、IFMShareItemIFMShareItemCell。其中IFMShareItemCellUICollectionView的单元格,用户可以忽略它,

IFMShareItem

IFMShareItem是每一个要展示的cell的数据源,它有三种初始化方法,

- (instancetype)initWithImage:(UIImage *)image
                        title:(NSString *)title
                       action:(shareHandle)action;

- (instancetype)initWithImage:(UIImage *)image
                        title:(NSString *)title
                   actionName:(NSString *)actionName;

- (instancetype)initWithPlatformName:(NSString *)platformName;

- (instancetype)initWithPlatformName:(NSString *)platformName;只需要传入预制的分享平台名称,比如:

IFMPlatformNameSina;  // 新浪微博
IFMPlatformNameQQ;    //QQ
IFMPlatformNameEmail; //邮箱
IFMPlatformNameSms;   //短信

即可快速初始化一个包括title、image和action的分享cell

如果提供的image不符合您的要求,您可以使用以下方法初始化一个IFMShareItem

- (instancetype)initWithImage:(UIImage *)image
                        title:(NSString *)title
                   actionName:(NSString *)actionName;

其中actionName传入预制的分享action,比如:

IFMPlatformHandleSina;  // 新浪微博
IFMPlatformHandleQQ;    //QQ
IFMPlatformHandleEmail; //邮箱
IFMPlatformHandleSms;   //短信

如果预制的action不能满足您的分享内容类型,还可以使用以下方法,

- (instancetype)initWithImage:(UIImage *)image
                        title:(NSString *)title
                       action:(shareHandle)action;

action是一个Block块,类型如下,

typedef void (^__nullable shareHandle)(IFMShareItem *item);

您可以在这个Block块里写入点击按钮以后需要执行的动作。

IFMShareView

IFMShareView是包含了所有展示控件的View,提供了三种初始化方法

- (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize DisplayLine:(BOOL)inLine;
- (instancetype)initWithShareItems:(NSArray *)shareItems functionItems:(NSArray *)functionItems itemSize:(CGSize)itemSize;
- (instancetype)initWithItems:(NSArray *)items countEveryRow:(NSInteger)count;//默认九宫格样式

如果您要展示的是一个单行的分享界面,使用以下方法:

- (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize DisplayLine:(BOOL)inLine;

如果是双行,您一定猜到了,使用以下方法:

- (instancetype)initWithShareItems:(NSArray *)shareItems functionItems:(NSArray *)functionItems itemSize:(CGSize)itemSize;

其中itemSize是需要传入的IFMShareItemCell大小,IFMShareView会根据传入的itemSize自动调整自己的大小。如果您想使用默认大小,传入一个预制的宏IFMShareItemCellSize,为CGSizeMake(80, 100)shareItems是第一行的分享性质的按钮数组,functionItems是第二行功能性质的按钮数组,存放的是IFMShareItem或者预制的分享平台名称,比如:IFMPlatformNameSina、IFMPlatformNameEmail

如果您要使用的分享界面是一个九宫格类型的,使用以下初始化方法

- (instancetype)initWithItems:(NSArray *)items countEveryRow:(NSInteger)count;//默认九宫格样式

count表示每一行展示的item个数,

个性化

除了以上功能,IFMShare还提供了丰富的可定制属性。

@property (nullable, nonatomic, strong) UIView *headerView;//头部分享标题
@property (nullable, nonatomic, strong) UIView *footerView;//尾部其他自定义View

可以传入用户绘制好的头部和尾部的View,IFMShareView会将它们放在合适的位置。

@property (nonatomic, strong) UIButton *cancleButton;//取消

用户可以获取到底部取消按钮,修改它的背景色、标题、圆角等。

@property (nullable, nonatomic, strong) UIColor *middleLineColor;//分割线颜色
@property (nonatomic) CGFloat middleLineEdgeSpace;//分割线边距
@property (nonatomic) CGFloat middleTopSpace;//分割线距离上部按钮距离
@property (nonatomic) CGFloat middleBottomSpace;//分割线距离下部按钮距离

可以设置分割线的各种属性,以及以下属性:

@property (nullable, nonatomic, strong) UIColor *containViewColor;
@property (nullable, nonatomic, strong) UIFont *itemTitleFont; //标题字体大小
@property (nullable, nonatomic, strong) UIColor *itemTitleColor; //标题字体颜色

@property (nonatomic) UIEdgeInsets bodyViewEdgeInsets;//中间bodyView的边距;
@property (nonatomic) CGSize itemSize; //item大小
@property (nonatomic) CGSize itemImageSize; //item中image大小
@property (nonatomic) BOOL showBorderLine; //是否显示cell边界线
@property (nonatomic) CGFloat itemImageTopSpace; //item图片距离顶部大小
@property (nonatomic) CGFloat iconAndTitleSpace; //item图片和文字距离
@property (nonatomic) CGFloat itemSpace;//item横向间距
@property (nonatomic) BOOL showsHorizontalScrollIndicator;//是否显示横向滚动条
@property (nonatomic) BOOL showCancleButton;//是否显示取消按钮

您可以试着玩一玩。使用过程中有任何问题,请在issue中提出,或者邮件联系我,或者关注我的新浪微博@小刘大刚,我会及时修改更新,谢谢您的支持,希望我的代码可以给您灵感,同时也帮助我成长,世界因为开源而美好。

TODO

  • [ ] 支持cocoapods
  • [ ] 加入更多预制平台
  • [ ] 介绍对比4种分享方案
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].