项目介绍:
PDFloraButton
一个开花按钮,点击按钮会弹出簇拥一周的小按钮菜单效果。使用PDFloraButton.swift即可简单添加。按钮图片可以自定义,使用简单。
Screen Shot
Predefined Positions
center, topLeft, topRight, bottomLeft, bottomRight, midTop, midBottom, midLeft, midRight
Easy usability Swift 3.0
import UIKit
class ViewController: UIViewController {
let floraButton = PDFloraButton(withPosition: .center, size: 50.0, numberOfPetals: 20, images:[])
let floraButton2 = PDFloraButton(withPosition: .topLeft, size: 50.0, numberOfPetals: 4, images:[])
let floraButton3 = PDFloraButton(withPosition: .topRight, size: 50.0, numberOfPetals: 4, images:[])
let floraButton4 = PDFloraButton(withPosition: .bottomLeft, size: 50.0, numberOfPetals: 4, images:[])
let floraButton5 = PDFloraButton(withPosition: .bottomRight, size: 50.0, numberOfPetals: 4, images:[])
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(floraButton)
self.view.addSubview(floraButton2)
self.view.addSubview(floraButton3)
self.view.addSubview(floraButton4)
self.view.addSubview(floraButton5)
floraButton.buttonActionDidSelected = { (indexSelected) in
debugPrint("Selected Index: \(indexSelected)")
}
}
}