From 1ee16b02d54bd8c71ae365bdb56d7389702839ea Mon Sep 17 00:00:00 2001 From: matt handler Date: Tue, 26 Apr 2011 17:21:39 -0400 Subject: sort topics when popping out of the database, customize photoview controller, need to add sharekit --- Classes/PhotoViewController.m | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'Classes/PhotoViewController.m') diff --git a/Classes/PhotoViewController.m b/Classes/PhotoViewController.m index 1b43094..151aabd 100644 --- a/Classes/PhotoViewController.m +++ b/Classes/PhotoViewController.m @@ -8,6 +8,59 @@ #import "PhotoViewController.h" #import "PhotoSource.h" +#import + +@interface MyPhotoViewController : TTPhotoViewController +{ + +} +@end + +@implementation MyPhotoViewController + +-(void)viewDidLoad{ + // New item to be added + UIBarButtonItem *shareItem = [[UIBarButtonItem alloc] + initWithTitle:@"Share" style:UIBarButtonItemStyleBordered target:self + action:@selector(action:)]; + UIBarButtonItem *customItem = [[UIBarButtonItem alloc] + initWithTitle:@"Save" style:UIBarButtonItemStyleBordered target:self + action:@selector(action:)]; + // Flex space to keep the back / forward arrows centered + UIBarButtonItem *flex = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil action:nil]; + UIBarButtonItem *flex2 = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil action:nil]; + // Create array with items starting with the left side + NSMutableArray *items = [NSMutableArray arrayWithObject:shareItem]; + [items addObject:flex]; + // Then add the current items (the back / forward arrows) + [items addObjectsFromArray:[_toolbar items]]; + [items addObject:flex2]; + // Add in our new item to the far right + [items addObject:customItem]; + [_toolbar setItems:items]; + [shareItem release]; + [customItem release]; + [flex release]; + [flex2 release]; +} + +-(void)action:(id)sender{ + // Perform your action +} + +@end + + +@implementation TTThumbsViewController (test) +- (TTPhotoViewController*)createPhotoViewController { + NSLog(@"test"); + return (TTPhotoViewController *)[[[MyPhotoViewController alloc] init] autorelease]; +} +@end @implementation PhotoViewController -- cgit v1.2.3