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

Commit

Permalink
* Support shake-to-reload again, this time using new OS 3.0 motion ge…
Browse files Browse the repository at this point in the history
…stures

* Update title of thumbs view controller after loading the photo source
  • Loading branch information
joehewitt committed Jul 21, 2009
1 parent 7e3cc2b commit d674718
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
17 changes: 16 additions & 1 deletion src/TTNavigator.m
Expand Up @@ -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,
Expand Down Expand Up @@ -77,7 +92,7 @@ - (void)ensureWindow {
if (keyWindow) {
_window = [keyWindow retain];
} else {
_window = [[UIWindow alloc] initWithFrame:TTScreenBounds()];
_window = [[TTNavigatorWindow alloc] initWithFrame:TTScreenBounds()];
[_window makeKeyAndVisible];
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/TTThumbsViewController.m
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions src/Three20.xcodeproj/project.pbxproj
Expand Up @@ -408,6 +408,8 @@
BE702EF80F43F9D20028A119 /* TTTableItem.m */,
BE702ED10F43F3390028A119 /* TTTableItemCell.h */,
BE702ECF0F43F32E0028A119 /* TTTableItemCell.m */,
BE781808100ECF21001FACA5 /* TTSearchDisplayController.h */,
BE781806100ECF0F001FACA5 /* TTSearchDisplayController.m */,
);
name = Tables;
sourceTree = "<group>";
Expand Down Expand Up @@ -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>";
Expand Down

0 comments on commit d674718

Please sign in to comment.