I have a vertical UIScrollView just wide enough for a single column of buttons. The buttons can be dragged by the user, but when one is being moved I want the other buttons to move up or down out of the way. The only way that I can think of to do this is in the UIPanGestureRecognizer responsible for moving the button, every time its method gets called running a for loop in the subviews, checking the y values. That seems incredibly inefficient, and would require keeping track of which buttons have already moved to prevent moving them more than once. There has to be a better way. Any ideas?
I have a vertical UIScrollView just wide enough for a single column of buttons.
Share
the same functionality has been implemented in this project and in this project also . I hope project code will help you to solve your problem.