Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: facebookarchive/three20
...
head fork: mogeneration/three20
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 0 commit comments
  • 3 contributors
Commits on Oct 30, 2009
@sync sync removed private firstResponder calls, safe only because using ttimage…
…view
eaed4fc
Commits on Nov 05, 2009
@tomjadams tomjadams Fixed apple private APIs
UITouch._locationInWindow
UITouch._phase
UITouch._previousLocationInWindow
UITouch._tapCount
UITouch._timestamp
UITouch._touchFlags
UITouch._view
UITouch._window
cc44e2f
Commits on Sep 20, 2010
@Crufty Crufty Added loadImageFromFile: for the image loader 4f71a81
View
13 src/TTGlobal.m
@@ -38,11 +38,6 @@ BOOL TTIsEmptyString(id object) {
return [object isKindOfClass:[NSString class]] && ![(NSString*)object length];
}
-BOOL TTIsKeyboardVisible() {
- UIWindow* window = [UIApplication sharedApplication].keyWindow;
- return !![window performSelector:@selector(firstResponder)];
-}
-
BOOL TTIsPhoneSupported() {
NSString *deviceType = [UIDevice currentDevice].model;
return [deviceType isEqualToString:@"iPhone"];
@@ -286,6 +281,14 @@ BOOL TTIsDocumentsURL(NSString* URL) {
}
}
+BOOL TTIsFileURL(NSString* URL) {
+ if (URL.length >= 16) {
+ return [URL rangeOfString:@"file://localhost" options:0 range:NSMakeRange(0,16)].location == 0;
+ } else {
+ return NO;
+ }
+}
+
NSString* TTPathForBundleResource(NSString* relativePath) {
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
return [resourcePath stringByAppendingPathComponent:relativePath];
View
5 src/TTMessageController.m
@@ -472,9 +472,6 @@ - (BOOL)persistView:(NSMutableDictionary*)state {
CGFloat scrollY = _scrollView.contentOffset.y;
[state setObject:[NSNumber numberWithFloat:scrollY] forKey:@"scrollOffsetY"];
- NSInteger firstResponder = [self fieldIndexOfFirstResponder];
- [state setObject:[NSNumber numberWithInt:firstResponder] forKey:@"firstResponder"];
- [state setObject:[NSNumber numberWithBool:YES] forKey:@"__important__"];
return [super persistView:state];
}
@@ -500,8 +497,6 @@ - (void)restoreView:(NSDictionary*)state {
NSNumber* scrollY = [state objectForKey:@"scrollOffsetY"];
_scrollView.contentOffset = CGPointMake(0, scrollY.floatValue);
- NSInteger firstResponder = [[state objectForKey:@"firstResponder"] intValue];
- [self setFieldIndexOfFirstResponder:firstResponder];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
View
1  src/TTTableViewController.m
@@ -229,7 +229,6 @@ - (void)restoreView:(NSDictionary*)state {
- (void)keyboardDidAppear:(BOOL)animated withBounds:(CGRect)bounds {
[super keyboardDidAppear:animated withBounds:bounds];
self.tableView.frame = TTRectContract(self.tableView.frame, 0, bounds.size.height);
- [self.tableView scrollFirstResponderIntoView];
[self layoutOverlayView];
[self layoutBannerView];
}
View
11 src/TTURLCache.m
@@ -115,6 +115,12 @@ - (UIImage*)loadImageFromDocuments:(NSString*)URL {
return [UIImage imageWithData:data];
}
+- (UIImage*)loadImageFromFile:(NSString*)URL {
+ // NSString* path = [URL substringFromIndex:16];
+ NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:URL]];
+ return [UIImage imageWithData:data];
+}
+
- (NSString*)createTemporaryURL {
static int temporaryURLIncrement = 0;
return [NSString stringWithFormat:@"temp:%d", temporaryURLIncrement++];
@@ -257,8 +263,11 @@ - (id)imageForURL:(NSString*)URL fromDisk:(BOOL)fromDisk {
} else if (TTIsDocumentsURL(URL)) {
image = [self loadImageFromDocuments:URL];
[self storeImage:image forURL:URL];
- }
+ } else if (TTIsFileURL(URL)) {
+ image = [self loadImageFromFile:URL];
+ //[self storeImage:image forURL:URL];
}
+}
return image;
}
View
13 src/Three20.xcodeproj/project.pbxproj
@@ -791,7 +791,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
@@ -925,10 +932,11 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = .;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
PREBINDING = NO;
- SDKROOT = iphonesimulator3.0;
+ SDKROOT = iphoneos4.1;
};
name = Debug;
};
@@ -939,9 +947,10 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.0;
OTHER_LDFLAGS = "-ObjC";
PREBINDING = NO;
- SDKROOT = iphonesimulator3.0;
+ SDKROOT = iphoneos4.1;
};
name = Release;
};
View
7 src/Three20/TTGlobal.h
@@ -169,11 +169,6 @@ BOOL TTIsEmptyArray(id object);
BOOL TTIsEmptyString(id object);
/**
- * Tests if the keyboard is visible.
- */
-BOOL TTIsKeyboardVisible();
-
-/**
* Tests if the device has phone capabilities.
*/
BOOL TTIsPhoneSupported();
@@ -312,6 +307,8 @@ BOOL TTIsBundleURL(NSString* URL);
BOOL TTIsDocumentsURL(NSString* URL);
+BOOL TTIsFileURL(NSString* URL);
+
NSString* TTPathForBundleResource(NSString* relativePath);
NSString* TTPathForDocumentsResource(NSString* relativePath);
View
2  src/Three20/UITableViewAdditions.h
@@ -24,8 +24,6 @@
- (void)scrollToLastRow:(BOOL)animated;
-- (void)scrollFirstResponderIntoView;
-
- (void)touchRowAtIndexPath:(NSIndexPath*)indexPath animated:(BOOL)animated;
@end
View
12 src/UITableViewAdditions.m
@@ -60,18 +60,6 @@ - (void)scrollToLastRow:(BOOL)animated {
}
}
-- (void)scrollFirstResponderIntoView {
- UIView* responder = [self.window performSelector:@selector(firstResponder)];
- UITableViewCell* cell = (UITableViewCell*)[responder ancestorOrSelfWithClass:[UITableViewCell class]];
- if (cell) {
- NSIndexPath* indexPath = [self indexPathForCell:cell];
- if (indexPath) {
- [self scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle
- animated:YES];
- }
- }
-}
-
- (void)touchRowAtIndexPath:(NSIndexPath*)indexPath animated:(BOOL)animated {
if (![self cellForRowAtIndexPath:indexPath]) {
[self reloadData];
View
16 src/UIViewAdditions.m
@@ -33,6 +33,8 @@ - (void)dealloc {
@end
+// HAX Commented out as this category contains private APIs.
+#ifdef DEBUG
@interface UITouch (TTCategory)
- (id)initInView:(UIView *)view location:(CGPoint)location;
@@ -91,6 +93,8 @@ - (id)initWithTouch:(UITouch *)touch {
@end
+#endif
+
@implementation UIView (TTCategory)
- (CGFloat)left {
@@ -300,17 +304,7 @@ - (void)simulateTapAtPoint:(CGPoint)location {
#endif
- (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight {
- CGRect frame = self.frame;
- if ([self.window performSelector:@selector(firstResponder)]) {
- CGRect screenFrame = TTScreenBounds();
- CGFloat keyboardTop = (screenFrame.size.height - (TTKeyboardHeight() + plusHeight));
- CGFloat screenBottom = self.screenY + frame.size.height;
- CGFloat diff = screenBottom - keyboardTop;
- if (diff > 0) {
- frame.size.height -= diff;
- }
- }
- return frame;
+ return CGRectZero;
}
- (void)presentAsKeyboardAnimationDidStop {

No commit comments for this range

Something went wrong with that request. Please try again.