summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/NewPostViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-08-28 21:03:22 +0300
committerGravatar Vitaly Takmazov2016-08-28 21:03:22 +0300
commit188d8e4ea870d1a6c8edd5a9b323742804badeba (patch)
tree071067f7189a6474d49abb952b1b04b820985b7a /Juick/ViewControllers/NewPostViewController.m
parenta74588083c4950e9237dff7a84ccdd129b72c950 (diff)
project cleanup
Diffstat (limited to 'Juick/ViewControllers/NewPostViewController.m')
-rw-r--r--Juick/ViewControllers/NewPostViewController.m61
1 files changed, 61 insertions, 0 deletions
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m
new file mode 100644
index 0000000..8c8fbf0
--- /dev/null
+++ b/Juick/ViewControllers/NewPostViewController.m
@@ -0,0 +1,61 @@
+//
+// NewPostViewController.m
+// Juick
+//
+// Created by Vitaly Takmazov on 07.11.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import "NewPostViewController.h"
+
+@interface NewPostViewController ()
+
+@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
+ target:self action:@selector(cancelCompose)];
+ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
+ 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];
+}
+
+- (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.
+}
+
+@end