Floaty
Floaty copied to clipboard
Isn't the [weak self] needed in addItem() ?
This is the example of usage of Floaty buttons on this github repo. The code below creates a Floaty button and add on item inside.
let floaty = Floaty()
floaty.addItem("I got a handler", icon: UIImage(named: "icon")!, handler: { item in
let alert = UIAlertController(title: "Hey", message: "I'm hungry...", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Me too", style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)
floaty.close()
})
So my question is, are you sure that we really dont need a [weak self]
since the method addItem
is having a handler as an escaping closure?