Advantages, problems, examples of adding another UIWindow to an iOS app?

前端 未结 3 886
無奈伤痛
無奈伤痛 2020-11-27 10:04

Recently I\'ve been wondering about the fact that that an iOS app only has one UIWindow. It does not seem to be an issue to create another UIWindow

3条回答
  •  半阙折子戏
    2020-11-27 10:38

    Here is Apple's Documentation for better understanding UIWindow: https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/WindowScreenRolesinApp/WindowScreenRolesinApp.html

    One good though specific reason to use multiple instances of UIWindow is when you need to video record the app screen. You may not want to include certain elements (recording button, recording status, etc.) in the final recorded video, so you can put those elements in a separate UIWindow on top.

    In fact, if you are using ReplayKit, you will have to use a separate UIWindow for these excluded UI elements. More info here: https://medium.com/ar-tips-and-tricks/how-to-record-a-screen-capture-with-replaykit-whilst-hiding-the-hud-element-bedcca8e31e

提交回复
热议问题