From 8c69b5408e5d2870d60f15662f1d567e6cd55da7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 7 Nov 2013 11:01:08 +0400 Subject: NewPostViewController stub --- Juick.xcodeproj/project.pbxproj | 6 +++++ Juick/MessagesViewController.h | 1 + Juick/MessagesViewController.m | 11 ++++++++- Juick/NewPostViewController.h | 13 +++++++++++ Juick/NewPostViewController.m | 49 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Juick/NewPostViewController.h create mode 100644 Juick/NewPostViewController.m diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index 0e7a9b3..c4ed003 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 77317BD0181BBE8500D60005 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAF181BBE8500D60005 /* UIKit.framework */; }; 77317BD8181BBE8500D60005 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 77317BD6181BBE8500D60005 /* InfoPlist.strings */; }; 77317BDA181BBE8500D60005 /* JuickTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 77317BD9181BBE8500D60005 /* JuickTests.m */; }; + 77975A1D182B6E9A00410C2B /* NewPostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77975A1C182B6E9A00410C2B /* NewPostViewController.m */; }; 77A0954A181F1F25002BDECD /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 77A09549181F1F25002BDECD /* Message.m */; }; 77C67EDE182827DB00427098 /* reveal-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDC182827DB00427098 /* reveal-icon.png */; }; 77C67EDF182827DB00427098 /* reveal-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDD182827DB00427098 /* reveal-icon@2x.png */; }; @@ -63,6 +64,8 @@ 77317BD5181BBE8500D60005 /* JuickTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JuickTests-Info.plist"; sourceTree = ""; }; 77317BD7181BBE8500D60005 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 77317BD9181BBE8500D60005 /* JuickTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JuickTests.m; sourceTree = ""; }; + 77975A1B182B6E9A00410C2B /* NewPostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewPostViewController.h; sourceTree = ""; }; + 77975A1C182B6E9A00410C2B /* NewPostViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewPostViewController.m; sourceTree = ""; }; 77A09548181F1F25002BDECD /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = ""; }; 77A09549181F1F25002BDECD /* Message.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Message.m; sourceTree = ""; }; 77C67EDC182827DB00427098 /* reveal-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon.png"; sourceTree = ""; }; @@ -170,6 +173,8 @@ 77C67EF11828442C00427098 /* UIImage+Crop.m */, 77DC49E618296EA300A1136A /* UIImage+Helpers.h */, 77DC49E718296EA300A1136A /* UIImage+Helpers.m */, + 77975A1B182B6E9A00410C2B /* NewPostViewController.h */, + 77975A1C182B6E9A00410C2B /* NewPostViewController.m */, ); path = Juick; sourceTree = ""; @@ -343,6 +348,7 @@ 77A0954A181F1F25002BDECD /* Message.m in Sources */, 77317BC2181BBE8500D60005 /* MessagesViewController.m in Sources */, 77C67EE21828288C00427098 /* RevealPanelViewController.m in Sources */, + 77975A1D182B6E9A00410C2B /* NewPostViewController.m in Sources */, 77C67EE81828379700427098 /* ColorsAndButtons.m in Sources */, 77C67EE51828342000427098 /* NSURL+PathParameters.m in Sources */, 77317BB8181BBE8500D60005 /* main.m in Sources */, 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 - (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 + +@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 -- cgit v1.2.3