Get the current first responder without using a private API

前端 未结 28 2503
夕颜
夕颜 2020-11-22 05:03

I submitted my app a little over a week ago and got the dreaded rejection email today. It tells me that my app cannot be accepted because I\'m using a non-public API; specif

28条回答
  •  情书的邮戳
    2020-11-22 05:51

    you can call privite api like this ,apple ignore:

    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    SEL sel = NSSelectorFromString(@"firstResponder");
    UIView   *firstResponder = [keyWindow performSelector:sel];
    

提交回复
热议问题