diff options
Diffstat (limited to 'Classes/PhotoViewController.m')
-rw-r--r-- | Classes/PhotoViewController.m | 53 |
1 files changed, 53 insertions, 0 deletions
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 <Three20/Three20.h> + +@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 |