Recently, I encountered a demand similar to the segmented pop-up window of Gaode map (as shown in the figure below). I didn’t find relevant information on the Internet, so I wrote one myself, hoping to provide you with ideas.
The idea is that when the pop-up window is in the first segment, add uipangestrurerecognizer gesture to the tableview. Before the pop-up window reaches the top, use uipangestrurerecognizer gesture to change the pop-up window coordinates and size. When the pop-up window reaches the second segment, remove uipangestrurerecognizer gesture, and the tableview can respond to the drag gesture, When the tableview slides to the top, it slides upward, and changes the pop-up coordinates through the scrollviewdidscroll proxy method. When the finger leaves the screen, it is processed in the scrollviewwillenddragging proxy method, and finally the pop-up window is in the first paragraph. This is the overall idea.
That’s the core code. There’s no typesetting. I don’t know how to write with developer. Please bear with me…
Demo address: https://github.com/SuperEvilRabbit/pickViewDemo