diff options
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/MessagesViewController.h | 1 | ||||
-rw-r--r-- | Juick/MessagesViewController.m | 11 | ||||
-rw-r--r-- | Juick/NewPostViewController.h | 13 | ||||
-rw-r--r-- | Juick/NewPostViewController.m | 49 |
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 |