diff options
author | Vitaly Takmazov | 2019-12-10 11:09:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-12-10 11:09:34 +0300 |
commit | 925072af5ee9febc3cbefed45505f4857eb88e5e (patch) | |
tree | 7f5bc88786b85b23b2d2bfacf200d73e838efbae | |
parent | b438eaa6668204e7f13c87879920111f00fa054a (diff) |
Cancel button in New post view
-rw-r--r-- | Juick/Main.storyboard | 9 | ||||
-rw-r--r-- | Juick/ViewControllers/NewPostViewController.h | 1 | ||||
-rw-r--r-- | 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 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Rbr-km-xhI"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Rbr-km-xhI"> <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -259,6 +259,11 @@ <viewLayoutGuide key="safeArea" id="UJz-7C-l1q"/> </view> <navigationItem key="navigationItem" id="Yd6-Yh-gtd"> + <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="pNy-rM-fck"> + <connections> + <action selector="cancelPost:" destination="rr1-jx-MLx" id="KPp-Tz-5vV"/> + </connections> + </barButtonItem> <barButtonItem key="rightBarButtonItem" enabled="NO" title="Send" id="GOm-zk-CTO"> <connections> <action selector="sendAction:" destination="rr1-jx-MLx" id="Nd3-Zm-2GK"/> 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 |