Permalink
Browse files

* Support shake-to-reload again, this time using new OS 3.0 motion ge…

…stures

* Update title of thumbs view controller after loading the photo source
  • Loading branch information...
1 parent 7e3cc2b commit d674718e112d87e70b0d94120deadcb5b3ab0b4f @joehewitt joehewitt committed Jul 21, 2009
Showing with 27 additions and 5 deletions.
  1. +16 −1 src/TTNavigator.m
  2. +7 −0 src/TTThumbsViewController.m
  3. +4 −4 src/Three20.xcodeproj/project.pbxproj
View
@@ -7,6 +7,21 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
+@interface TTNavigatorWindow : UIWindow
+@end
+
+@implementation TTNavigatorWindow
+
+- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
+ if (event.type == UIEventSubtypeMotionShake && [TTNavigator navigator].supportsShakeToReload) {
+ [[TTNavigator navigator] reload];
+ }
+}
+
+@end
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
@implementation TTNavigator
@synthesize delegate = _delegate, URLMap = _URLMap, window = _window,
@@ -77,7 +92,7 @@ - (void)ensureWindow {
if (keyWindow) {
_window = [keyWindow retain];
} else {
- _window = [[UIWindow alloc] initWithFrame:TTScreenBounds()];
+ _window = [[TTNavigatorWindow alloc] initWithFrame:TTScreenBounds()];
[_window makeKeyAndVisible];
}
}
@@ -230,6 +230,13 @@ - (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
+- (void)modelDidChangeLoadedState {
+ [super modelDidChangeLoadedState];
+ if (self.modelState & TTModelStateLoaded) {
+ self.title = _photoSource.title;
+ }
+}
+
//////////////////////////////////////////////////////////////////////////////////////////////////
// UIViewController (TTCategory)
@@ -408,6 +408,8 @@
BE702EF80F43F9D20028A119 /* TTTableItem.m */,
BE702ED10F43F3390028A119 /* TTTableItemCell.h */,
BE702ECF0F43F32E0028A119 /* TTTableItemCell.m */,
+ BE781808100ECF21001FACA5 /* TTSearchDisplayController.h */,
+ BE781806100ECF0F001FACA5 /* TTSearchDisplayController.m */,
);
name = Tables;
sourceTree = "<group>";
@@ -612,18 +614,16 @@
BEF31F570F352E64000DE5D2 /* TTViewController.m */,
BE52E93E100D7DEE00E03DB7 /* TTModelViewController.h */,
BE52E940100D7DFD00E03DB7 /* TTModelViewController.m */,
- BEE34EAF0F495C4A008C826E /* TTMessageController.h */,
- BEE34EAD0F495C42008C826E /* TTMessageController.m */,
BEA69ECC0FAC0FEC00DA7DDC /* TTWebController.h */,
BEA69ECA0FAC0FD600DA7DDC /* TTWebController.m */,
+ BEE34EAF0F495C4A008C826E /* TTMessageController.h */,
+ BEE34EAD0F495C42008C826E /* TTMessageController.m */,
BED037A2100920CC0083AC18 /* TTPopupViewController.h */,
BED037A0100920C60083AC18 /* TTPopupViewController.m */,
BED036EC10090FB90083AC18 /* TTAlertViewController.h */,
BED036EA10090FAA0083AC18 /* TTAlertViewController.m */,
BED03763100915700083AC18 /* TTActionSheetController.h */,
BED03765100915820083AC18 /* TTActionSheetController.m */,
- BE781808100ECF21001FACA5 /* TTSearchDisplayController.h */,
- BE781806100ECF0F001FACA5 /* TTSearchDisplayController.m */,
);
name = "View Controllers";
sourceTree = "<group>";

0 comments on commit d674718

Please sign in to comment.