summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-11-07 11:01:08 +0400
committerGravatar Vitaly Takmazov2013-11-07 11:01:08 +0400
commit8c69b5408e5d2870d60f15662f1d567e6cd55da7 (patch)
tree563a9e95a376be23789985f680158c70461fdc22 /Juick
parentb3eaef8a304ce89242c649cfd0386a66e463acb2 (diff)
NewPostViewController stub
Diffstat (limited to 'Juick')
-rw-r--r--Juick/MessagesViewController.h1
-rw-r--r--Juick/MessagesViewController.m11
-rw-r--r--Juick/NewPostViewController.h13
-rw-r--r--Juick/NewPostViewController.m49
4 files changed, 73 insertions, 1 deletions
diff --git a/Juick/MessagesViewController.h b/Juick/MessagesViewController.h
index a5081de..be69672 100644
--- a/Juick/MessagesViewController.h
+++ b/Juick/MessagesViewController.h
@@ -11,4 +11,5 @@
@interface MessagesViewController : UITableViewController<UISplitViewControllerDelegate>
- (id)initWithURL:(NSURL *)messagesURL;
- (void) refreshData:(UIRefreshControl *)refresh;
+- (void) composePressed;
@end
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m
index 2f5cc29..55f8a19 100644
--- a/Juick/MessagesViewController.m
+++ b/Juick/MessagesViewController.m
@@ -9,12 +9,14 @@
#import "SWRevealViewController.h"
#import "MessagesViewController.h"
-
#import "MessageCell.h"
#import "Message.h"
#import "ColorsAndButtons.h"
+#import "NewPostViewController.h"
+
+
#import "NSURL+PathParameters.h"
#import "UIImage+Helpers.h"
@@ -101,6 +103,9 @@ static NSString *CellIdentifier = @"MessageCell";
UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"]
style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)];
self.navigationItem.leftBarButtonItem = revealButtonItem;
+ UIBarButtonItem *compose = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose
+ target:self action:@selector(composePressed)];
+ self.navigationItem.rightBarButtonItem = compose;
}
self.messages = [NSMutableArray array];
UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
@@ -113,6 +118,10 @@ static NSString *CellIdentifier = @"MessageCell";
}
+- (void) composePressed {
+ [self.navigationController pushViewController:[[NewPostViewController alloc] init] animated:YES];
+}
+
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
diff --git a/Juick/NewPostViewController.h b/Juick/NewPostViewController.h
new file mode 100644
index 0000000..ceaca49
--- /dev/null
+++ b/Juick/NewPostViewController.h
@@ -0,0 +1,13 @@
+//
+// NewPostViewController.h
+// Juick
+//
+// Created by Vitaly Takmazov on 07.11.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface NewPostViewController : UIViewController
+
+@end
diff --git a/Juick/NewPostViewController.m b/Juick/NewPostViewController.m
new file mode 100644
index 0000000..9e3db14
--- /dev/null
+++ b/Juick/NewPostViewController.m
@@ -0,0 +1,49 @@
+//
+// 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 {
+ [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void) doneCompose {
+ [self.navigationController popToRootViewControllerAnimated:YES];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+@end