UIApplication sharedApplication - keyWindow is nil?

后端 未结 4 1222
逝去的感伤
逝去的感伤 2020-12-03 16:34

I want to convert a CGPoint from my UIView to UIWindow coordinates and have realized that UIApplication keyWindow is always nil; why is this?

I have tried the

4条回答
  •  感动是毒
    2020-12-03 17:20

    This code was executed before [window makeKeyAndVisible]; which is inside the app delegate. So, no wonder why keyWindow was nil yet.

提交回复
热议问题