A custom view for iOS developers that provides a stack with up to four buttons.
Add the following delegate to your viewcontroller:
class ViewController: UIViewController, ButtonStackViewControllerDelegate
and call it inside an action:
var stack = ButtonStackViewController(mainButton: button, numberOfButtons: 4)
stack.delegate = self
self.presentViewController(stack, animated: false, completion: nil)
Use this protocol to manage the selected button from the stack:
func buttonStack(buttonStack: ButtonStackViewController, didSelect button: UIButton, atIndexPath indexPath: NSIndexPath)
and this one to know when the cancel button is pressed:
func buttonStackDidCancel(buttonStack: ButtonStackViewController)