Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RaisedCenterTabBar/Classes/BaseViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
-(UIViewController*) viewControllerWithTabTitle:(NSString*)title image:(UIImage*)image;

// Create a custom UIButton and add it to the center of our tab bar
-(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)highlightImage;
-(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)highlightImage target:(id)target action:(SEL)action;

@end
4 changes: 3 additions & 1 deletion RaisedCenterTabBar/Classes/BaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ -(UIViewController*) viewControllerWithTabTitle:(NSString*) title image:(UIImage
}

// Create a custom UIButton and add it to the center of our tab bar
-(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)highlightImage
-(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)highlightImage target:(id)target action:(SEL)action
{
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
Expand All @@ -55,6 +55,8 @@ -(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)
center.y = center.y - heightDifference/2.0;
button.center = center;
}

[button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:button];
}
Expand Down
7 changes: 6 additions & 1 deletion RaisedCenterTabBar/Classes/DailyBoothViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ - (void)viewDidLoad

-(void)willAppearIn:(UINavigationController *)navigationController
{
[self addCenterButtonWithImage:[UIImage imageNamed:@"camera_button_take.png"] highlightImage:[UIImage imageNamed:@"tabBar_cameraButton_ready_matte.png"]];
[self addCenterButtonWithImage:[UIImage imageNamed:@"camera_button_take.png"] highlightImage:[UIImage imageNamed:@"tabBar_cameraButton_ready_matte.png"] target:self action:@selector(buttonPressed:)];
}

- (void)buttonPressed:(id)sender {
NSLog(@"the button was pressed");
}


@end
6 changes: 5 additions & 1 deletion RaisedCenterTabBar/Classes/InstagramViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ - (void)viewDidLoad

-(void)willAppearIn:(UINavigationController *)navigationController
{
[self addCenterButtonWithImage:[UIImage imageNamed:@"cameraTabBarItem.png"] highlightImage:nil];
[self addCenterButtonWithImage:[UIImage imageNamed:@"cameraTabBarItem.png"] highlightImage:nil target:self action:@selector(buttonPressed:)];
}

- (void)buttonPressed:(id)sender {
NSLog(@"the button was pressed");
}

@end
7 changes: 6 additions & 1 deletion RaisedCenterTabBar/Classes/PathViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ - (void)viewDidLoad

-(void)willAppearIn:(UINavigationController *)navigationController
{
[self addCenterButtonWithImage:[UIImage imageNamed:@"capture-button.png"] highlightImage:nil];
[self addCenterButtonWithImage:[UIImage imageNamed:@"capture-button.png"] highlightImage:nil target:self action:@selector(buttonPressed:)];
}

- (void)buttonPressed:(id)sender {
NSLog(@"the button was pressed.");
}


@end