简体   繁体   中英

TopView is not accessible from presented view controllers

I am having a view which is added to UIApplication.keyWindow to make it visible to all viewControllers. But this view is not accessible when some controller is presented and over it another controller is presented. The above said view is not accessible from second presented controller.

I am using this code UIApplication.shared.keyWindow.addSubView(myView).

So how can i made my view accessible from here.

I have shared two images here. One is normal and another one view debugging.

Image1 Image2

只需将代码UIApplication.shared.keyWindow.addSubView(myView)放入viewDidAppear中,即可解决上述问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM