iOS浮动动作按钮:ActionButton

jopen 10年前

ActionButton 是一个用 Swift 编写的浮动动作按钮,灵感来自 Google Inbox。

导入

You can use CocoaPods to integrate Action Button in your project. You can install it with the following command

$ gem install cocoapods

Update yourPodfileto use Action Button

pod 'ActionButton'

Then, run the following command

$ pod install

用法

Define your actions
let share = ActionButtonItem(title: "share", image: shareImage)  share.action = { item in println("Sharing...") }    let email = ActionButtonItem(title: "email", image: emailImage)  email.action = { item in println("Email...") }

Create a Action Button with your actions

actionButton = ActionButton(attachedToView: view, items: [share, email])  actionButton.action = { button in button.toggleMenu() }


iOS浮动动作按钮:ActionButton

项目主页:http://www.open-open.com/lib/view/home/1433901161161