Permalink
Browse files

[AppStore] Deprecate screenX and screenY due to app store rejections.

Please use the new safeScreenX and safeScreenY.
  • Loading branch information...
1 parent abb5506 commit 46e07bc437e1cb2eb7718bf4153ad7673c63e004 @jverkoey jverkoey committed Dec 10, 2009
Showing with 39 additions and 7 deletions.
  1. +1 −1 src/TTPickerTextField.m
  2. +1 −1 src/TTSearchTextField.m
  3. +22 −2 src/Three20/UIViewAdditions.h
  4. +15 −3 src/UIViewAdditions.m
View
@@ -264,7 +264,7 @@ - (void)showSearchResults:(BOOL)show {
- (CGRect)rectForSearchResults:(BOOL)withKeyboard {
UIView* superview = self.superviewForSearchResults;
- CGFloat y = superview.screenY;
+ CGFloat y = superview.safeScreenY;
CGFloat visibleHeight = [self heightWithLines:1];
CGFloat keyboardHeight = withKeyboard ? TTKeyboardHeight() : 0;
CGFloat tableHeight = TTScreenBounds().size.height - (y + visibleHeight + keyboardHeight);
View
@@ -486,7 +486,7 @@ - (CGRect)rectForSearchResults:(BOOL)withKeyboard {
CGFloat height = self.height;
CGFloat keyboardHeight = withKeyboard ? TTKeyboardHeight() : 0;
- CGFloat tableHeight = self.window.height - (self.screenY + height + keyboardHeight);
+ CGFloat tableHeight = self.window.height - (self.safeScreenY + height + keyboardHeight);
return CGRectMake(0, y + self.height-1, superview.frame.size.width, tableHeight+1);
}
@@ -17,6 +17,8 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
+#import "Three20/TTGlobalCore.h"
+
@interface UIView (TTCategory)
/**
@@ -78,12 +80,30 @@
/**
* Return the x coordinate on the screen.
*/
-@property(nonatomic,readonly) CGFloat screenX;
+@property(nonatomic,readonly) CGFloat safeScreenX;
/**
* Return the y coordinate on the screen.
*/
-@property(nonatomic,readonly) CGFloat screenY;
+@property(nonatomic,readonly) CGFloat safeScreenY;
+
+#ifdef DEBUG
+
+/**
+ * Return the x coordinate on the screen.
+ *
+ * This method is being rejected by Apple due to false-positive private api static analysis.
+ */
+@property(nonatomic,readonly) CGFloat screenX __TTDEPRECATED_METHOD;
+
+/**
+ * Return the y coordinate on the screen.
+ *
+ * This method is being rejected by Apple due to false-positive private api static analysis.
+ */
+@property(nonatomic,readonly) CGFloat screenY __TTDEPRECATED_METHOD;
+
+#endif
/**
* Return the x coordinate on the screen, taking into account scroll views.
View
@@ -195,22 +195,34 @@ - (void)setHeight:(CGFloat)height {
self.frame = frame;
}
-- (CGFloat)screenX {
+- (CGFloat)safeScreenX {
CGFloat x = 0;
for (UIView* view = self; view; view = view.superview) {
x += view.left;
}
return x;
}
-- (CGFloat)screenY {
+- (CGFloat)safeScreenY {
CGFloat y = 0;
for (UIView* view = self; view; view = view.superview) {
y += view.top;
}
return y;
}
+#ifdef DEBUG
+
+- (CGFloat)screenX {
+ return [self safeScreenX];
+}
+
+- (CGFloat)screenY {
+ return [self safeScreenY];
+}
+
+#endif
+
- (CGFloat)screenViewX {
CGFloat x = 0;
for (UIView* view = self; view; view = view.superview) {
@@ -330,7 +342,7 @@ - (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight {
if (TTIsKeyboardVisible()) {
CGRect screenFrame = TTScreenBounds();
CGFloat keyboardTop = (screenFrame.size.height - (TTKeyboardHeight() + plusHeight));
- CGFloat screenBottom = self.screenY + frame.size.height;
+ CGFloat screenBottom = self.safeScreenY + frame.size.height;
CGFloat diff = screenBottom - keyboardTop;
if (diff > 0) {
frame.size.height -= diff;

0 comments on commit 46e07bc

Please sign in to comment.