5987045388
http://codereview.appspot.com/4798055/ git-svn-id: http://skia.googlecode.com/svn/trunk@2022 2bbb7eff-a529-9590-31e7-b0007b416f81
51 lines
1.5 KiB
Plaintext
51 lines
1.5 KiB
Plaintext
#import "SkUISplitViewController.h"
|
|
|
|
@implementation SkUISplitViewController
|
|
@synthesize fRoot, fDetail;
|
|
|
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
|
return YES; //Auto Rotation for all orientations
|
|
}
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
self.delegate = self;
|
|
[fDetail populateRoot:fRoot];
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[fRoot release];
|
|
[fDetail release];
|
|
[super dealloc];
|
|
}
|
|
|
|
//Table View Delegate Methods
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
[fDetail goToItem:indexPath.row];
|
|
if (fRoot.popoverController != nil) {
|
|
[fRoot.popoverController dismissPopoverAnimated:YES];
|
|
}
|
|
}
|
|
|
|
//Split View Controller Delegate
|
|
- (void)splitViewController:(UISplitViewController*)svc
|
|
willHideViewController:(UIViewController *)aViewController
|
|
withBarButtonItem:(UIBarButtonItem*)barButtonItem
|
|
forPopoverController:(UIPopoverController*)pc {
|
|
|
|
barButtonItem.title = @"Samples";
|
|
fRoot.popoverController = pc;
|
|
fRoot.popoverButtonItem = barButtonItem;
|
|
[fDetail showRootPopoverButtonItem:fRoot.popoverButtonItem];
|
|
}
|
|
|
|
- (void)splitViewController:(UISplitViewController*)svc
|
|
willShowViewController:(UIViewController *)aViewController
|
|
invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
|
|
[fDetail invalidateRootPopoverButtonItem:fRoot.popoverButtonItem];
|
|
fRoot.popoverController = nil;
|
|
fRoot.popoverButtonItem = nil;
|
|
}
|
|
|
|
@end
|