-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FloatyItem add Click handler #268
Comments
Hey, did you get any solution for this ? I need to call a custom method for haptics on click, but can’t seem figure out how. |
Wow its been a long time @ThisIsBugFixxer I created this function then i call it in func setupFab() -> Floaty {
let floaty = Floaty()
floaty.buttonColor = #colorLiteral(red: 2.387956192e-05, green: 0.5332912803, blue: 0.8063663244, alpha: 1)
floaty.plusColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
floaty.openAnimationType = .pop
let floatyItem = FloatyItem()
floatyItem.title = "..."
floatyItem.icon = UIImage(named: "Groupe 3024")
floatyItem.titleLabel.layer.frame = CGRect(x: -210, y: 0, width: 205, height: 40)
let padding = UIEdgeInsets(top: 6, left: 16, bottom: 6, right: 16)
floatyItem.titleLabel.layer.bounds.inset(by: padding)
floatyItem.titleLabel.font = UIFont(name: "Avenir Medium", size: 16)
floatyItem.titleLabel.textAlignment = .center
floatyItem.titleLabel.layer.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
floatyItem.titleLabel.layer.cornerRadius = 7
floatyItem.titleLabel.layer.borderColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
floatyItem.titleLabel.layer.borderWidth = 1
floatyItem.titleLabel.textColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
// Item Click
floatyItem.handler = { item in
(self.parent?.parent as! <ParentController>).showAlert()
floaty.close()
}
floaty.addItem(item: floatyItem)
return floaty
}
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(setupFab())
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I tried to setup a floaty like this :
But i dont find any method to use the click handler on the floatyItem !
Any idea please ?
The text was updated successfully, but these errors were encountered: