欢迎光临
我们一直在努力

【swift】PDFloraButton

建站超值云服务器,限时71元/月

【swift】PDFloraButton

项目介绍:

PDFloraButton

一个开花按钮,点击按钮会弹出簇拥一周的小按钮菜单效果。使用PDFloraButton.swift即可简单添加。按钮图片可以自定义,使用简单。

Screen Shot

alt tag

Predefined Positions

center, topLeft, topRight, bottomLeft, bottomRight, midTop, midBottom, midLeft, midRight

alt tag

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)")
    }
}

}

code4app

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 【swift】PDFloraButton
分享到: 更多 (0)