Idea is to have a stack view of button aligned horizontally or vertically as per specification.
Follow below steps:
rootStackViewcontains series of buttons. ( like $,$$, $$$, etc.. )
- Pin both
rootStackViewinside the UIView to establish corner radius functionality.
- Have key variables like
updateButtonImage. These variables values will be altered during expanding /unexpanding the buttons via
performAnimationis called when button is toggled, this method performs below functionalities
Hides the rootStackView
update the button image to dotted_filled
hiding the sub layers left borders while animation is happening
update the width Constraint
remove constraints if any
Complete source code available in Github
Any feedback is really appreciated. Happy Coding. !!