Hi all,
one of my apps has been recently rejected becuase (according to apple) it uses private APIs ("3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.").
The non-public API that is included in my application is UIWebDocumentView.
That's kind of new, I used the same code for months without any problems.
Here's how I'm using it in my view, I'm wondering if you could help me to fix this issue:
myview.h
Code:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "songDatabase.h"
#import "WebView.h"
#import "UIWebDocumentView.h"
@interface APWindow : UIWindow {
songDatabase *database;
CGPoint startPos;
}
@end
myview.m
Code:
#import "APWindow.h"
#import "songView.h"
@class UIWebDocumentView;
@implementation APWindow
- (void)sendEvent:(UIEvent*)event {
if (database == nil)
database = [songDatabase sharedInstance];
if (database.songBeingViewed)
{
NSSet *allTouches = [event allTouches];
if ([allTouches count] == 1)
{
UITouch *aTouch = [allTouches anyObject];
if ([aTouch.view isMemberOfClass:[UIWebDocumentView class]])
{
if (aTouch.phase == UITouchPhaseBegan)
startPos = [aTouch locationInView:aTouch.view];
else if (aTouch.phase == UITouchPhaseEnded)
{
CGPoint endPos = [aTouch locationInView:aTouch.view];
CGFloat dx = endPos.x - startPos.x;
CGFloat dy = endPos.y - startPos.y;
if ((dx*dx + dy*dy) < 100) // a movement of <= 10 pixels
{
[[songDatabase sharedInstance].songView webViewWasTapped];
}
startPos.x = -1;
startPos.y = -1;
}
}
}
}
[super sendEvent:event];
}
@end
Thanks