代码库> 弹出视图> MMShareSheet介绍(自定义的分享弹出框组件[类似于微信支付宝的链接分享])
MMShareSheet介绍(自定义的分享弹出框组件[类似于微信支付宝的链接分享])
关注
上传者:小冒CC 分类:弹出视图(Popup View)
查看次数:1160 下载次数:263
上传时间:2017-10-15 大小:3 KB
## MMShareSheet

### Introduction

MMShareSheet 是一个简单的弹出选择框,使用纯swift编写,类似于微信(或支付宝)里面的分享(朋友圈打开网页右上角分享)控件。

### Rquirements

* iOS 8.0+
* Xcode 9 (swift 4)
* Xcode 8 (swift 3)
* If you want to run demo in swift3, please switch branch to swift3.0

### Installation


#### Install with Cocoapods

* `pod 'MMShareSheet', '~> 1.0'`
* `import MMShareSheet ` in you code


#### Copy code into project

[克隆代码](https://github.com/MinMao-Hub/MMShareSheet.git),然后将components文件夹下面的两个文件 `MMShareSheet.swift` 和 `MMCardItem.swift`加入到你的项目中即可。


### Usage

```swift
let cards = [
[
[
"title": "微信好友",
"icon": "wechat",
"handler": "wxfriend"
],[
"title": "微信朋友圈",
"icon": "moment",
"handler": "wxmoment"
],[
"title": "QQ好友",
"icon": "qq",
"handler": "qqfriend",
]
],[
[
"title": "拷贝",
"icon": "copy_link",
"handler": "copy"
],[
"title": "在Safari中打开",
"icon": "safari",
"handler": "safari"
]
]
]

let cancelBtn = [
"title": "取消",
"handler": "cancel",
"type": "default",
]
let mmShareSheet = MMShareSheet.init(title: "此网页由wx.keeponrunning.com提供", cards: cards, duration: nil, cancelBtn: cancelBtn)
mmShareSheet.callBack = { (handler) ->() in
print(handler)
}
mmShareSheet.present()

```

### Contacts

[Github: MinMao-Hub](https://github.com/MinMao-Hub)
[Email: 1286090267@qq.com](1286090267@qq.com)

希望喜欢的朋友们给小星星哦☆【star】
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0
提示
sina weixin mail 回到顶部