IOS segmented pop-up window

Time:2021-12-8

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.

IOS segmented pop-up window

IOS segmented pop-up window

Realization effect

IOS segmented pop-up window

IOS segmented pop-up window

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.

Partial code

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

IOS segmented pop-up window

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