Skip to content

Instantly share code, notes, and snippets.

@catehstn

catehstn/ViewController.m

Last active Aug 29, 2015
Embed
What would you like to do?
#import "ViewController.h"
#import "Presenter.h"
@implementation ViewController {
Presenter *presenter_;
}
@synthesize presenter = presenter_;
- (id)initWithPresenter:(Presenter *)presenter {
self = [super init];
if (self) {
presenter_ = presenter;
[presenter setViewController:self];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[[self navigationItem] setLeftBarButtonItems:[[self presenter] leftNavigationButtons]
animated:YES];
[[self navigationItem] setRightBarButtonItems:[[self presenter] rightNavigationButtons]
animated:YES];
[presenter_ viewLoaded];
}
- (void)dismissViewControllerAnimated:(BOOL)animated
withCompletionBlock:(void (^)(void))completionBlock {
[[self navigationController] dismissViewControllerAnimated:animated
completion:completionBlock];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment