From 925072af5ee9febc3cbefed45505f4857eb88e5e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 10 Dec 2019 11:09:34 +0300 Subject: Cancel button in New post view --- Juick/Main.storyboard | 9 +++++++-- Juick/ViewControllers/NewPostViewController.h | 1 + Juick/ViewControllers/NewPostViewController.m | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard index f2d84ee..212e384 100644 --- a/Juick/Main.storyboard +++ b/Juick/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -259,6 +259,11 @@ + + + + + diff --git a/Juick/ViewControllers/NewPostViewController.h b/Juick/ViewControllers/NewPostViewController.h index 9d1297c..637aa08 100644 --- a/Juick/ViewControllers/NewPostViewController.h +++ b/Juick/ViewControllers/NewPostViewController.h @@ -19,5 +19,6 @@ extern NSString * const ReplyPostedNotificationName; @property (strong, nonatomic) NSString *draft; @property (strong, nonatomic) Message *replyTo; +- (IBAction)cancelPost:(id)sender; @end diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m index 4bb3758..e4b5ac7 100644 --- a/Juick/ViewControllers/NewPostViewController.m +++ b/Juick/ViewControllers/NewPostViewController.m @@ -101,4 +101,7 @@ NSString * const ReplyPostedNotificationName = @"ReplyPosted"; self.navigationItem.rightBarButtonItem.enabled = [textView.text length]; } +- (IBAction)cancelPost:(id)sender { + [self dismissViewControllerAnimated:YES completion:nil]; +} @end -- cgit v1.2.3