How to add view in UIWindow?

前端 未结 8 1409
星月不相逢
星月不相逢 2021-02-14 22:42

I wanted to add a view in UIWindow with following code:

 AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
 UIWindo         


        
8条回答
  •  甜味超标
    2021-02-14 23:18

    Try this code:

    window = [[UIApplication sharedApplication].windows lastObject];
    

    Replace the following code:

    window = [[UIApplication sharedApplication].windows objectAtIndex:0];
    

提交回复
热议问题