Monday, 15 September 2014

objective c - Get the current first responder without using a private API -


I submitted my app to a small one week ago and today I got a lousy rejection email that tells me that my The app can not be accepted because I am using a non-public API; Specifically, it says,

The non-public API that is included in your application is the first prepaid.

Now, the abusive API call is actually a solution I found here:

  UIWindow * keyWindow = [[UIApplication shared application] keyWindow ]; UIView * firstResponder = [keyWindow Display Selector: @Selector (First Responder)];  

How do I get the current first responder on screen? I'm looking for a way out of my app that will not reject my app.

In my application, I often want to first reply that if the user moves on the background, For I wrote a category on UIView, which I call on UI window.

is based on the following and should be responded first.

  @implementation UIView (FindFirstResponder) - (ID) Find FirstResponder {if (self.isFirstResponder) {Return Self; } (For self.subviews in UIView * subView) {ID responder = [subView findFirstResponder]; If (Respondents) Respondents of Return; } Return zero; } @end  

iOS 7 +

  - (ID) FindFirstSponder {if (Selffisher Repotter) {Return Self; } (For UIView * subView in self.view.subviews) {if ([subView isFirstResponder]) {return subView; }} Return zero; }  

No comments:

Post a Comment