项目介绍:
MMActionSheet
Github: MMActionSheet
Introduction
MMActionSheet 是一个简单的弹出选择框,使用纯swift编写,类似于微信的actionsheet
Rquirements
-
iOS 8.0+
-
Xcode 9 (swift 4)
-
current code keep on swift4
-
-
Xcode 8 (swift 3)
-
If you want to run demo in swift3, please switch branch to swift3.0
-
Installation
① Cocoapods
-
pod 'MMActionSheet', '~> 0.0.5'
-
import MMActionSheet
in you code
② Copy code into project
克隆代码,然后将components文件夹下面的两个文件 MMActionSheet.swift
和 MMButton.swift
加入到你的项目中即可。
Usage
let buttons = [
[
"title": "拍照",
"handler": "camera",
],[
"title": "相册",
"handler": "photos",
"type": "default"
]
]
let mmActionSheet = MMActionSheet.init(title: "请选择照片", buttons: buttons, duration: nil, cancel: true)
mmActionSheet.callBack = { (handler) ->() in
print(handler)
}
mmActionSheet.present()
Contacts
Github: MinMao-Hub
Email: 1286090267@qq.com
喜欢的朋友请给个星星哦【star】