一款带有选项的简单可完全自定义的浮动操作按钮
var fabConfig = MIFab.Config()
fabConfig.buttonImage = UIImage(named: "iconC")
fabConfig.buttonBackgroundColor = UIColor.orange
fab = MIFab(
parentVC: self,
config: fabConfig,
options: [
MIFabOption(
title: "Item 2",
image: UIImage(named: "iconB"),
backgroundColor: UIColor.orange,
tintColor: UIColor.white,
actionClosure: {
let alertController = UIAlertController(title: "Demo", message: "Second fab button tapped", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
self.present(alertController, animated: true, completion: nil)
}
),
MIFabOption(
title: "Item 1",
image: UIImage(named: "iconA"),
backgroundColor: UIColor.orange,
tintColor: UIColor.white,
actionClosure: {
let alertController = UIAlertController(title: "Demo", message: "First fab button tapped", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
self.present(alertController, animated: true, completion: nil)
}
)
]
)
showButton(animated: Bool = false)
hideButton(animated: Bool = false)
在此存储库中您还可以找到演示。
如果您喜欢这个 git,可以在以下位置关注我或推特 :) @MarioIannotta
来自意大利的问候!