diff options
author | Vitaly Takmazov | 2017-09-27 22:24:38 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-09-27 22:24:38 +0300 |
commit | 6499148cb3f62e20534b62c181125ebeacfa3438 (patch) | |
tree | 3aa289caa409366e70dd1802d67df61903fa992b /Juick/ViewControllers/NewPostViewController.m | |
parent | 25bc4f1357252dc0aeee70f0a638a4226231d5fb (diff) |
cleanup
Diffstat (limited to 'Juick/ViewControllers/NewPostViewController.m')
-rw-r--r-- | Juick/ViewControllers/NewPostViewController.m | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m index 8c8fbf0..318de4e 100644 --- a/Juick/ViewControllers/NewPostViewController.m +++ b/Juick/ViewControllers/NewPostViewController.m @@ -7,55 +7,33 @@ // #import "NewPostViewController.h" +#import "ColorScheme.h" @interface NewPostViewController () +@property (nonatomic, assign) BOOL didSetupConstraints; + @end @implementation NewPostViewController -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - - (void)viewDidLoad { [super viewDidLoad]; - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + self.navigationController.visibleViewController.title = @"Post"; + self.view.backgroundColor = [ColorScheme mainBackground]; + self.navigationController.visibleViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelCompose)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone - target:self action:@selector(doneCompose)]; + self.navigationController.visibleViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd + target:self action:@selector(doneCompose)]; } - (void) cancelCompose { - CATransition* transition = [CATransition animation]; - transition.duration = 0.3; - transition.type = kCATransitionFade; - transition.subtype = kCATransitionFromTop; - - [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; - [self.navigationController popViewControllerAnimated:NO]; + [self.navigationController.visibleViewController.navigationController popViewControllerAnimated:YES]; } - (void) doneCompose { - CATransition* transition = [CATransition animation]; - transition.duration = 0.3; - transition.type = kCATransitionFade; - transition.subtype = kCATransitionFromTop; - - [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; - [self.navigationController popToRootViewControllerAnimated:NO]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. + [self.navigationController.visibleViewController.navigationController popToRootViewControllerAnimated:YES]; } @end |