Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
* Disable code that uses private APIs except in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
joehewitt committed Oct 29, 2009
1 parent e8ecb80 commit 8183ae2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Three20/UIViewAdditions.h
Expand Up @@ -44,7 +44,9 @@
/**
* WARNING: This depends on undocumented APIs and may be fragile. For testing only.
*/
#ifdef DEBUG
- (void)simulateTapAtPoint:(CGPoint)location;
#endif

/**
* Calculates the offset of this view from another view in screen coordinates.
Expand Down
2 changes: 2 additions & 0 deletions src/UIViewAdditions.m
Expand Up @@ -285,6 +285,7 @@ - (void)removeAllSubviews {
}
}

#ifdef DEBUG
- (void)simulateTapAtPoint:(CGPoint)location {
UITouch *touch = [[[UITouch alloc] initInView:self location:location] autorelease];

Expand All @@ -296,6 +297,7 @@ - (void)simulateTapAtPoint:(CGPoint)location {
UIEvent *eventUp = [[[UIEvent alloc] initWithTouch:touch] autorelease];
[touch.view touchesEnded:[NSSet setWithObject:touch] withEvent:eventUp];
}
#endif

- (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight {
CGRect frame = self.frame;
Expand Down
2 changes: 2 additions & 0 deletions src/UIWebViewAdditions.m
Expand Up @@ -22,6 +22,7 @@ - (CGRect)frameOfElement:(NSString*)query {
return CGRectMake(x, y, width, height);
}

#ifdef DEBUG
- (void)simulateTapElement:(NSString*)query {
CGRect frame = [self.window convertRect:self.frame fromView:self.superview];
CGRect pluginFrame = [self frameOfElement:query];
Expand All @@ -31,5 +32,6 @@ - (void)simulateTapElement:(NSString*)query {
);
[self simulateTapAtPoint:tapPoint];
}
#endif

@end

2 comments on commit 8183ae2

@dsharma
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used Three20 code for my photo library and got a rejection twice -- first time, for the above mentioned code containing UITouch Variables. This time, for using "firstResponder" which is also supposed to be private. Is it possible to know all the private parts of Three20 by any chance ?

@jverkoey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're working on making three20 app-store compliant, shouldn't be too much longer.

Please sign in to comment.