Currently, all the popover menus, loadingview, and so on are engaged in views, which can be solved. However, the display is actually quite troublesome. You have to ensure full screen, removefromsuperview at addsubview, and removefromsuperview at the disappearance. You also need to ensure that the view is at the top level and the code is not highly reusable.
In fact, the iPhone supports multi-window display and hierarchical display, that is, the windowlevel of the window is set. Similar properties on Mac can be used to display windows with different effects.
Then we can completely alloc a window and make it a keywindow, so all touch events will be captured by it. And it is a view. You can set the backgroundcolor in addsubview. The problem is simple. You should be able to understand the popoverwindow principle on the iPad.
That is to generate a window with the fullscreen windowlevel ui‑walertlevel, And the backgroundcolor is clearcolor. Then, add the view of the Controller to be displayed to the subview, and draw a border around the view in drawrect, draw an arrow on the pop-up point and display it in an animation. Then, click the blank area of the window to make the animation disappear.
Uialertview is simpler. Although it inherits from uiview, its implementation should be no different from that of uiwindow. In fact, it should also be a window, set different content heights and adjust the content size according to different subviews.
Code implementation address: http://www.cocoachina.com/bbs/read.php? Tid-30657.html