TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2016 |
SPMSupports SPM | ✗ |
Maintained by Mario Iannotta.
A simple fully customizable floating action button with options
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)
In this repository you can also find a demo.
If you like this git you can follow me here or on twitter :) @MarioIannotta
Cheers from Italy!