• R/O
  • HTTP
  • SSH
  • HTTPS

Tombo: Commit

TOMBO source code


Commit MetaInfo

Revisionc09718f64600516fdaf1ab28b427c82666dd0975 (tree)
Time2012-04-03 19:03:47
AuthorHirami <tomohisa.hirami@nift...>
CommiterHirami

Log Message

Change detail view structure.

Change Summary

Incremental Difference

--- a/iOS/Tombo/Tombo.xcodeproj/project.pbxproj
+++ b/iOS/Tombo/Tombo.xcodeproj/project.pbxproj
@@ -7,6 +7,9 @@
77 objects = {
88
99 /* Begin PBXBuildFile section */
10+ 9228CF2815298F7200E20355 /* EditCancelAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9228CF2715298F7200E20355 /* EditCancelAlert.m */; };
11+ 922F592A15295FAA009B1E32 /* EditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 922F592915295FAA009B1E32 /* EditViewController.m */; };
12+ 9243C7B51529D8610092B506 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9243C7B41529D8610092B506 /* DetailViewController.m */; };
1013 92DE332D151E277D00AD06EC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE332C151E277D00AD06EC /* UIKit.framework */; };
1114 92DE332F151E277D00AD06EC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE332E151E277D00AD06EC /* Foundation.framework */; };
1215 92DE3331151E277D00AD06EC /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE3330151E277D00AD06EC /* CoreGraphics.framework */; };
@@ -16,14 +19,12 @@
1619 92DE3340151E277D00AD06EC /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 92DE333E151E277D00AD06EC /* MainStoryboard_iPhone.storyboard */; };
1720 92DE3343151E277D00AD06EC /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 92DE3341151E277D00AD06EC /* MainStoryboard_iPad.storyboard */; };
1821 92DE3346151E277D00AD06EC /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE3345151E277D00AD06EC /* MasterViewController.m */; };
19- 92DE3349151E277D00AD06EC /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE3348151E277D00AD06EC /* DetailViewController.m */; };
2022 92DE3351151E277E00AD06EC /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE3350151E277E00AD06EC /* SenTestingKit.framework */; };
2123 92DE3352151E277E00AD06EC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE332C151E277D00AD06EC /* UIKit.framework */; };
2224 92DE3353151E277E00AD06EC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE332E151E277D00AD06EC /* Foundation.framework */; };
2325 92DE335B151E277E00AD06EC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 92DE3359151E277E00AD06EC /* InfoPlist.strings */; };
2426 92DE335E151E277E00AD06EC /* TomboTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE335D151E277E00AD06EC /* TomboTests.m */; };
2527 92DE33861522998700AD06EC /* Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE33851522998700AD06EC /* Storage.m */; };
26- 92DE338D1522F61200AD06EC /* CustomSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE338C1522F61200AD06EC /* CustomSegue.m */; };
2728 92DE33901522FFEC00AD06EC /* FileItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE338F1522FFEB00AD06EC /* FileItem.m */; };
2829 92DE339F15231CFC00AD06EC /* Folder-32.png in Resources */ = {isa = PBXBuildFile; fileRef = 92DE339B15231CFC00AD06EC /* Folder-32.png */; };
2930 92DE33A015231CFC00AD06EC /* Folder-48.png in Resources */ = {isa = PBXBuildFile; fileRef = 92DE339C15231CFC00AD06EC /* Folder-48.png */; };
@@ -44,6 +45,12 @@
4445 /* End PBXContainerItemProxy section */
4546
4647 /* Begin PBXFileReference section */
48+ 9228CF2615298F7200E20355 /* EditCancelAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditCancelAlert.h; sourceTree = "<group>"; };
49+ 9228CF2715298F7200E20355 /* EditCancelAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditCancelAlert.m; sourceTree = "<group>"; };
50+ 922F592815295FAA009B1E32 /* EditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditViewController.h; sourceTree = "<group>"; };
51+ 922F592915295FAA009B1E32 /* EditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditViewController.m; sourceTree = "<group>"; };
52+ 9243C7B31529D8610092B506 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; };
53+ 9243C7B41529D8610092B506 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = "<group>"; };
4754 92DE3328151E277D00AD06EC /* Tombo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tombo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4855 92DE332C151E277D00AD06EC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
4956 92DE332E151E277D00AD06EC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -58,8 +65,6 @@
5865 92DE3342151E277D00AD06EC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
5966 92DE3344151E277D00AD06EC /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = "<group>"; };
6067 92DE3345151E277D00AD06EC /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = "<group>"; };
61- 92DE3347151E277D00AD06EC /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; };
62- 92DE3348151E277D00AD06EC /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = "<group>"; };
6368 92DE334F151E277E00AD06EC /* TomboTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TomboTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
6469 92DE3350151E277E00AD06EC /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
6570 92DE3358151E277E00AD06EC /* TomboTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TomboTests-Info.plist"; sourceTree = "<group>"; };
@@ -68,8 +73,6 @@
6873 92DE335D151E277E00AD06EC /* TomboTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TomboTests.m; sourceTree = "<group>"; };
6974 92DE33841522998700AD06EC /* Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Storage.h; sourceTree = "<group>"; };
7075 92DE33851522998700AD06EC /* Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Storage.m; sourceTree = "<group>"; };
71- 92DE338B1522F61200AD06EC /* CustomSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomSegue.h; sourceTree = "<group>"; };
72- 92DE338C1522F61200AD06EC /* CustomSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomSegue.m; sourceTree = "<group>"; };
7376 92DE338E1522FFEB00AD06EC /* FileItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileItem.h; sourceTree = "<group>"; };
7477 92DE338F1522FFEB00AD06EC /* FileItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileItem.m; sourceTree = "<group>"; };
7578 92DE339B15231CFC00AD06EC /* Folder-32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Folder-32.png"; sourceTree = "<group>"; };
@@ -144,15 +147,17 @@
144147 92DE3341151E277D00AD06EC /* MainStoryboard_iPad.storyboard */,
145148 92DE3344151E277D00AD06EC /* MasterViewController.h */,
146149 92DE3345151E277D00AD06EC /* MasterViewController.m */,
147- 92DE3347151E277D00AD06EC /* DetailViewController.h */,
148- 92DE3348151E277D00AD06EC /* DetailViewController.m */,
150+ 922F592815295FAA009B1E32 /* EditViewController.h */,
151+ 922F592915295FAA009B1E32 /* EditViewController.m */,
152+ 9228CF2615298F7200E20355 /* EditCancelAlert.h */,
153+ 9228CF2715298F7200E20355 /* EditCancelAlert.m */,
149154 92DE3333151E277D00AD06EC /* Supporting Files */,
150155 92DE33841522998700AD06EC /* Storage.h */,
151156 92DE33851522998700AD06EC /* Storage.m */,
152157 92DE338E1522FFEB00AD06EC /* FileItem.h */,
153158 92DE338F1522FFEB00AD06EC /* FileItem.m */,
154- 92DE338B1522F61200AD06EC /* CustomSegue.h */,
155- 92DE338C1522F61200AD06EC /* CustomSegue.m */,
159+ 9243C7B31529D8610092B506 /* DetailViewController.h */,
160+ 9243C7B41529D8610092B506 /* DetailViewController.m */,
156161 );
157162 path = Tombo;
158163 sourceTree = "<group>";
@@ -316,10 +321,11 @@
316321 92DE3339151E277D00AD06EC /* main.m in Sources */,
317322 92DE333D151E277D00AD06EC /* AppDelegate.m in Sources */,
318323 92DE3346151E277D00AD06EC /* MasterViewController.m in Sources */,
319- 92DE3349151E277D00AD06EC /* DetailViewController.m in Sources */,
320324 92DE33861522998700AD06EC /* Storage.m in Sources */,
321- 92DE338D1522F61200AD06EC /* CustomSegue.m in Sources */,
322325 92DE33901522FFEC00AD06EC /* FileItem.m in Sources */,
326+ 922F592A15295FAA009B1E32 /* EditViewController.m in Sources */,
327+ 9228CF2815298F7200E20355 /* EditCancelAlert.m in Sources */,
328+ 9243C7B51529D8610092B506 /* DetailViewController.m in Sources */,
323329 );
324330 runOnlyForDeploymentPostprocessing = 0;
325331 };
--- a/iOS/Tombo/Tombo/CustomSegue.h
+++ /dev/null
@@ -1,13 +0,0 @@
1-/*
2- * Custom segue
3- *
4- * if isStop is set to YES, transition is disabled.
5- * This segue is used by MainStoryboard_iPhone.
6- */
7-#import <UIKit/UIKit.h>
8-
9-@interface CustomSegue : UIStoryboardSegue
10-
11-@property BOOL isStop;
12-
13-@end
--- a/iOS/Tombo/Tombo/CustomSegue.m
+++ /dev/null
@@ -1,14 +0,0 @@
1-#import "CustomSegue.h"
2-
3-@implementation CustomSegue
4-
5-@synthesize isStop;
6-
7-- (void)perform {
8- if (self.isStop) return;
9-
10- UINavigationController *ctrl = [self.sourceViewController navigationController];
11- [ctrl pushViewController:self.destinationViewController
12- animated:YES];
13-}
14-@end
--- a/iOS/Tombo/Tombo/DetailViewController.h
+++ b/iOS/Tombo/Tombo/DetailViewController.h
@@ -1,12 +1,17 @@
11 #import <UIKit/UIKit.h>
22 #import "FileItem.h"
3-#import "Storage.h"
43
5-@interface DetailViewController : UIViewController <UISplitViewControllerDelegate,UITextViewDelegate>
4+@class MasterViewController;
5+/*
6+ * Right pane of split view.
7+ * Used on iPad only.
8+ */
69
7-@property (strong, nonatomic) FileItem *detailItem;
8-@property (strong, nonatomic) Storage *storage;
10+@interface DetailViewController : UIViewController
911
10-@property (weak, nonatomic) IBOutlet UITextView *detailText;
12+@property (strong, nonatomic) FileItem *item;
13+@property (weak, nonatomic) MasterViewController *master;
14+
15+@property (weak, nonatomic) IBOutlet UITextView *text;
1116
1217 @end
--- a/iOS/Tombo/Tombo/DetailViewController.m
+++ b/iOS/Tombo/Tombo/DetailViewController.m
@@ -1,176 +1,67 @@
11 #import "DetailViewController.h"
2+#import "EditViewController.h"
23 #import "MasterViewController.h"
34
4-@interface DetailViewController () {
5- BOOL isModify;
6-}
7-@property (strong, nonatomic) UIPopoverController *masterPopoverController;
8-- (void)configureView;
5+@interface DetailViewController ()
6+
97 @end
108
119 @implementation DetailViewController
10+@synthesize text = _text;
11+@synthesize item = _item;
12+@synthesize master = _master;
1213
13-@synthesize detailItem = _detailItem;
14-@synthesize storage;
15-@synthesize detailText = _detailText;
16-@synthesize masterPopoverController = _masterPopoverController;
17-
18-#pragma mark - Managing the detail item
19-
20-- (void)setDetailItem:(id)newDetailItem
14+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
2115 {
22- if (_detailItem != newDetailItem) {
23- // save current note
24- [self save];
25-
26- // set item
27- _detailItem = newDetailItem;
28-
29- // Update the view.
30- [self configureView];
16+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
17+ if (self) {
18+ // Custom initialization
3119 }
32-
33- if (self.masterPopoverController != nil) {
34- [self.masterPopoverController dismissPopoverAnimated:YES];
35- }
36-}
37-
38-- (void)configureView
39-{
40- NSString *noteData;
41- if (self.detailItem && self.detailItem.path) {
42- NSError *error;
43- noteData = [NSString stringWithContentsOfFile:self.detailItem.path
44- encoding:NSUTF8StringEncoding
45- error:&error];
46- if (error) return;
47- } else {
48- noteData = @"";
49- }
50- self.detailText.text = noteData;
20+ return self;
5121 }
5222
5323 - (void)viewDidLoad
5424 {
5525 [super viewDidLoad];
56- // Do any additional setup after loading the view, typically from a nib.
57- NSNotificationCenter *notify = [NSNotificationCenter defaultCenter];
58- [notify addObserver:self
59- selector:@selector(keyboardDidShow:)
60- name:UIKeyboardDidShowNotification
61- object:nil];
62-
63- [notify addObserver:self
64- selector:@selector(keyboardDidHide:)
65- name:UIKeyboardDidHideNotification
66- object:nil];
67-
68- self.detailText.delegate = self;
69- [self configureView];
70- isModify = NO;
26+ // Do any additional setup after loading the view.
7127 }
7228
7329 - (void)viewDidUnload
7430 {
75- [self setDetailText:nil];
76- self.detailItem = nil;
77- self.storage = nil;
31+ [self setText:nil];
7832 [super viewDidUnload];
79-}
80-
81-- (void)viewWillDisappear:(BOOL)animated {
82- // Leaving detail view
83- [self save];
84- [super viewWillDisappear: animated];
33+ // Release any retained subviews of the main view.
8534 }
8635
8736 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
8837 {
89- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
90- return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
91- } else {
92- return YES;
93- }
38+ return YES;
9439 }
9540
96-- (void)textViewDidChange:(UITextView *)textView {
97- isModify = YES;
98-}
41+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
42+ if ([[segue identifier] isEqualToString:@"editNote"]) {
43+ EditViewController *edit = (EditViewController*)[[[segue destinationViewController] viewControllers] objectAtIndex:0];
44+ edit.detailItem = self.item;
45+ edit.delegate = self.master;
9946
100-- (void)save {
101- if (!isModify) return;
102-
103- NSString *note = self.detailText.text;
104- FileItem *newPath = [storage save:note item: self.detailItem];
105- isModify = NO;
106-
107- MasterViewController *master;
108-
109- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
110- UINavigationController *v = [self.splitViewController.viewControllers objectAtIndex:0];
111- NSArray *a = v.viewControllers;
112- master = [a objectAtIndex:0];
113- } else {
114- // To notify master view, retract reference from navigation controller.
115- master = [self.navigationController.viewControllers objectAtIndex:0];
116- }
117-
118- if (self.detailItem.name) {
119- // item exists
120- if (self.detailItem != newPath) {
121- [master itemChanged: self.detailItem to:newPath];
122- }
123- } else {
124- // new item
125- [master itemAdded: newPath];
12647 }
12748 }
12849
129-#pragma mark - Notification handler
130-
131-- (void)keyboardDidShow:(NSNotification*)notification {
132- NSDictionary *info = [notification userInfo];
133-
134- CGRect beginRect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue] fromView:nil];
135- CGRect rect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
136- CGRect frame = self.detailText.frame;
137-
138- if (beginRect.size.height == rect.size.height) {
139- // slide in
140- frame.size.height -= rect.size.height;
50+- (void)setItem:(FileItem *)item {
51+ if (self.item == item) return;
52+ if (item.isNewItem) {
53+ self.text.text = @"";
14154 } else {
142- // keyboard change
143- frame.size.height -= (rect.size.height - beginRect.size.height);
55+ NSError *error;
56+ NSString *note = [NSString stringWithContentsOfFile:item.path
57+ encoding:NSUTF8StringEncoding
58+ error:&error];
59+ if (error) {
60+ self.text.text = @"";
61+ } else {
62+ self.text.text = note;
63+ }
14464 }
145- self.detailText.frame = frame;
146-
147-}
148-
149-- (void)keyboardDidHide:(NSNotification*)notification {
150-
151- NSDictionary *info = [notification userInfo];
152-
153- CGRect rect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
154- CGRect frame = self.detailText.frame;
155-
156- frame.size.height += rect.size.height;
157- self.detailText.frame = frame;
158-}
159-
160-#pragma mark - Split view
161-
162-- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
163-{
164- barButtonItem.title = NSLocalizedString(@"Master", @"Master");
165- [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
166- self.masterPopoverController = popoverController;
65+ _item = item;
16766 }
168-
169-- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
170-{
171- // Called when the view is shown again in the split view, invalidating the button and popover controller.
172- [self.navigationItem setLeftBarButtonItem:nil animated:YES];
173- self.masterPopoverController = nil;
174-}
175-
17667 @end
--- /dev/null
+++ b/iOS/Tombo/Tombo/EditCancelAlert.h
@@ -0,0 +1,4 @@
1+#import <UIKit/UIKit.h>
2+
3+@interface EditCancelAlert : UIAlertView
4+@end
--- /dev/null
+++ b/iOS/Tombo/Tombo/EditCancelAlert.m
@@ -0,0 +1,4 @@
1+#import "EditCancelAlert.h"
2+
3+@implementation EditCancelAlert
4+@end
--- /dev/null
+++ b/iOS/Tombo/Tombo/EditViewController.h
@@ -0,0 +1,23 @@
1+#import <UIKit/UIKit.h>
2+#import "FileItem.h"
3+#import "Storage.h"
4+
5+@protocol EditViewControllerDelegate;
6+
7+@interface EditViewController : UIViewController <UITextViewDelegate>
8+
9+@property (weak, nonatomic) id <EditViewControllerDelegate> delegate;
10+@property (strong, nonatomic) FileItem *detailItem;
11+@property (nonatomic) BOOL isModify;
12+
13+@property (weak, nonatomic) IBOutlet UITextView *detailText;
14+
15+- (IBAction)done:(id)sender;
16+- (IBAction)cancel:(id)sender;
17+
18+@end
19+
20+@protocol EditViewControllerDelegate <NSObject>
21+- (void)editViewControllerDidCancel:(EditViewController*)controller;
22+- (void)editViewControllerDidFinish:(EditViewController *)controller;
23+@end
\ No newline at end of file
--- /dev/null
+++ b/iOS/Tombo/Tombo/EditViewController.m
@@ -0,0 +1,126 @@
1+#import "EditViewController.h"
2+#import "MasterViewController.h"
3+
4+@interface EditViewController () {
5+}
6+@end
7+
8+@implementation EditViewController
9+
10+@synthesize detailItem = _detailItem;
11+@synthesize detailText = _detalText;
12+@synthesize delegate = _delegate;
13+@synthesize isModify = _isModify;
14+
15+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
16+{
17+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
18+ if (self) {
19+ // Custom initialization
20+ }
21+ return self;
22+}
23+
24+- (void)setDetailItem:(id)newDetailItem
25+{
26+ if (_detailItem != newDetailItem) {
27+ // set item
28+ _detailItem = newDetailItem;
29+
30+ // Update the view.
31+ [self configureView];
32+ }
33+}
34+
35+- (void)configureView {
36+ NSString *noteData;
37+ if (self.detailItem && self.detailItem.path) {
38+ NSError *error;
39+ noteData = [NSString stringWithContentsOfFile:self.detailItem.path
40+ encoding:NSUTF8StringEncoding
41+ error:&error];
42+ if (error) return;
43+ } else {
44+ noteData = @"";
45+ }
46+ self.detailText.text = noteData;
47+}
48+
49+
50+- (void)viewDidLoad {
51+ [super viewDidLoad];
52+ // Do any additional setup after loading the view, typically from a nib.
53+ NSNotificationCenter *notify = [NSNotificationCenter defaultCenter];
54+ [notify addObserver:self
55+ selector:@selector(keyboardDidShow:)
56+ name:UIKeyboardDidShowNotification
57+ object:nil];
58+
59+ [notify addObserver:self
60+ selector:@selector(keyboardDidHide:)
61+ name:UIKeyboardDidHideNotification
62+ object:nil];
63+
64+ self.detailText.delegate = self;
65+ [self configureView];
66+ self.isModify = NO;
67+}
68+
69+- (void)viewDidUnload {
70+ [self setDetailText:nil];
71+ self.detailItem = nil;
72+ [super viewDidUnload];
73+}
74+
75+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
76+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
77+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
78+ } else {
79+ return YES;
80+ }
81+}
82+- (void)textViewDidChange:(UITextView *)textView {
83+ self.isModify = YES;
84+}
85+
86+#pragma mark - Notification handler
87+
88+- (void)keyboardDidShow:(NSNotification*)notification {
89+ NSDictionary *info = [notification userInfo];
90+
91+ CGRect beginRect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue] fromView:nil];
92+ CGRect rect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
93+ CGRect frame = self.detailText.frame;
94+
95+ if (beginRect.size.height == rect.size.height) {
96+ // slide in
97+ frame.size.height -= rect.size.height;
98+ } else {
99+ // keyboard change
100+ frame.size.height -= (rect.size.height - beginRect.size.height);
101+ }
102+ self.detailText.frame = frame;
103+
104+}
105+
106+- (void)keyboardDidHide:(NSNotification*)notification {
107+
108+ NSDictionary *info = [notification userInfo];
109+
110+ CGRect rect = [self.detailText convertRect:[[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
111+ CGRect frame = self.detailText.frame;
112+
113+ frame.size.height += rect.size.height;
114+ self.detailText.frame = frame;
115+}
116+
117+#pragma mark - Action handler
118+
119+- (IBAction)cancel:(id)sender {
120+ [[self delegate] editViewControllerDidCancel:self];
121+}
122+- (IBAction)done:(id)sender {
123+ [[self delegate] editViewControllerDidFinish:self];
124+}
125+
126+@end
--- a/iOS/Tombo/Tombo/FileItem.h
+++ b/iOS/Tombo/Tombo/FileItem.h
@@ -13,4 +13,6 @@
1313
1414 +(id)allocWithName:(NSString *)name;
1515
16+- (BOOL)isNewItem;
17+
1618 @end
--- a/iOS/Tombo/Tombo/FileItem.m
+++ b/iOS/Tombo/Tombo/FileItem.m
@@ -19,4 +19,7 @@
1919 return fileItem;
2020 }
2121
22+- (BOOL)isNewItem {
23+ return self.name == nil;
24+}
2225 @end
--- a/iOS/Tombo/Tombo/MasterViewController.h
+++ b/iOS/Tombo/Tombo/MasterViewController.h
@@ -1,13 +1,9 @@
11 #import <UIKit/UIKit.h>
22 #import "FileItem.h"
3-
3+#import "EditViewController.h"
44 @class DetailViewController;
55
6-@interface MasterViewController : UITableViewController
6+@interface MasterViewController : UITableViewController <EditViewControllerDelegate>
77
88 @property (strong, nonatomic) DetailViewController *detailViewController;
9-
10-// Call back handler for detail view.
11-- (void)itemChanged:(FileItem *)from to:(FileItem *)to;
12-- (void)itemAdded: (FileItem *)item;
139 @end
--- a/iOS/Tombo/Tombo/MasterViewController.m
+++ b/iOS/Tombo/Tombo/MasterViewController.m
@@ -1,11 +1,12 @@
11 #import "MasterViewController.h"
2+#import "EditViewController.h"
23 #import "DetailViewController.h"
4+#import "EditCancelAlert.h"
35
46 #import "Storage.h"
5-#import "CustomSegue.h"
67 #import "FileItem.h"
78
8-@interface MasterViewController () {
9+@interface MasterViewController () <UIAlertViewDelegate, UITableViewDelegate> {
910 NSMutableArray *_objects;
1011 Storage *storage;
1112
@@ -32,21 +33,14 @@
3233 {
3334 [super viewDidLoad];
3435 // Do any additional setup after loading the view, typically from a nib.
35-// self.navigationItem.leftBarButtonItem = self.editButtonItem;
36-
37- UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
38- target:self
39- action:@selector(openNewNote:)];
40- self.navigationItem.rightBarButtonItem = addButton;
4136 self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
42-
37+ self.detailViewController.master = self;
38+
4339 imgFolder = nil;
4440 imgDocument = nil;
4541 if (!storage) {
4642 storage = [Storage init];
4743 }
48- self.detailViewController.storage = storage;
49- self.detailViewController.detailItem = [storage newItem];
5044
5145 // Load initial items.
5246 [self insertItems];
@@ -75,8 +69,6 @@
7569 [self performSegueWithIdentifier:@"newNote" sender:self];
7670 } else {
7771 // iPad : Clear detail view.
78- [self.detailViewController setDetailItem:nil];
79-
8072 }
8173 }
8274
@@ -198,62 +190,87 @@
198190 }
199191 */
200192
201-- (void)transitDetailView:(NSIndexPath *)indexPath controller:(DetailViewController*)controller {
193+// Select Row(iPhone/iPad)
194+// set item for iPad
195+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
196+{
197+// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
198+// [self transitDetailView:indexPath controller:self.detailViewController];
199+// }
202200 FileItem *item = [_objects objectAtIndex:indexPath.row];
203201 if (item.isUp) {
204202 // switch view items
205203 [self removeAllItems];
206204 [storage updir];
207- [self insertItems];
205+ [self insertItems];
208206 } else if (item.isDirectory) {
209- // switch view items
210207 [self removeAllItems];
211208 [storage chdir: item.name];
212- [self insertItems];
213-
209+ [self insertItems];
214210 } else {
215- [controller setDetailItem:item];
216- [controller setStorage: storage];
217- }
218-
219-}
220-
221-// Select Row(iPhone/iPad)
222-// set item for iPad
223-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
224-{
225- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
226- [self transitDetailView:indexPath controller:self.detailViewController];
211+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
212+ self.detailViewController.item = item;
213+ } else {
214+ [self performSegueWithIdentifier:@"editNote" sender:self];
215+ }
227216 }
228217 }
229218
230219 // set item (for iPhone)
231220 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
232221 {
233- if ([[segue identifier] isEqualToString:@"showDetail"]) {
234- NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
222+ if ([[segue identifier] isEqualToString:@"newNote"]) {
223+ EditViewController *edit = (EditViewController*)[[[segue destinationViewController] viewControllers] objectAtIndex:0];
224+ edit.detailItem = [storage newItem];
225+ edit.delegate = self;
226+ } else if ([[segue identifier] isEqualToString:@"editNote"]) {
227+ // This path is used only iPhone
228+ EditViewController *edit = (EditViewController*)[[[segue destinationViewController] viewControllers] objectAtIndex:0];
229+ NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
235230 FileItem *item = [_objects objectAtIndex:indexPath.row];
236- if (item.isUp || item.isDirectory) {
237- CustomSegue *customSegue = (CustomSegue*)segue;
238- customSegue.isStop = YES;
231+ edit.detailItem = item;
232+ edit.delegate = self;
233+ }
234+}
235+
236+#pragma mark - EditViewControllerDelegate
237+
238+- (void)editViewControllerDidFinish:(EditViewController *)controller {
239+ if (controller.isModify) {
240+ // save note
241+ if (![controller.detailItem isNewItem]) {
242+ [self deleteItem:controller.detailItem];
239243 }
240- [self transitDetailView:indexPath controller:[segue destinationViewController]];
241- } else if ([[segue identifier] isEqualToString:@"newNote"]) {
242- // When open new document, detailItem is newItem.
243- DetailViewController *detail = [segue destinationViewController];
244- detail.detailItem = [storage newItem];
245- detail.storage = storage;
244+ NSString *note = controller.detailText.text;
245+ FileItem *item = [storage save:note item:controller.detailItem];
246+ controller.isModify = NO;
247+
248+ self.detailViewController.item = item;
249+
250+ [self insertItem:item];
246251 }
252+ [self dismissModalViewControllerAnimated:YES];
247253 }
248254
249-- (void)itemChanged:(FileItem *)from to:(FileItem *)to {
250- // Remove old item and insert new item
251- [self deleteItem: from];
252- [self insertItem: to];
255+- (void)editViewControllerDidCancel:(EditViewController *)controller {
256+ if (controller.isModify) {
257+ UIAlertView *alert = [[EditCancelAlert alloc] initWithTitle:@"Confirm"
258+ message:@"Note is modified. Are you sure to discard changes?" delegate:self
259+ cancelButtonTitle:@"OK"
260+ otherButtonTitles:@"Cancel", nil];
261+ [alert show];
262+ } else {
263+ [self dismissModalViewControllerAnimated:YES];
264+ }
253265 }
254266
255-- (void)itemAdded:(FileItem *)item {
256- // Simply insert a item.
257- [self insertItem: item];
267+#pragma mark - AlertViewDelegate
268+
269+-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
270+ if ([alertView isKindOfClass:[EditCancelAlert class]]) {
271+ if (buttonIndex == 0) {
272+ [self dismissModalViewControllerAnimated:YES];
273+ }
274+ }
258275 }
259276 @end
--- a/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPad.storyboard
+++ b/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPad.storyboard
@@ -3,7 +3,7 @@
33 <dependencies>
44 <deployment defaultVersion="1296" identifier="iOS"/>
55 <development defaultVersion="4200" identifier="xcode"/>
6- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1179"/>
6+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1181"/>
77 </dependencies>
88 <scenes>
99 <!--Navigation Controller-->
@@ -19,7 +19,7 @@
1919 </connections>
2020 </navigationController>
2121 </objects>
22- <point key="canvasLocation" x="448" y="-630"/>
22+ <point key="canvasLocation" x="116" y="-494"/>
2323 </scene>
2424 <!--Detail View Controller - Detail-->
2525 <scene sceneID="16">
@@ -30,7 +30,7 @@
3030 <rect key="frame" x="0.0" y="64" width="703" height="704"/>
3131 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3232 <subviews>
33- <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" id="I5K-hl-l4m">
33+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" editable="NO" id="I5K-hl-l4m">
3434 <rect key="frame" x="0.0" y="0.0" width="703" height="704"/>
3535 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3636 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
@@ -42,13 +42,19 @@
4242 <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
4343 </view>
4444 <toolbarItems/>
45- <navigationItem key="navigationItem" title="Detail" id="53"/>
45+ <navigationItem key="navigationItem" title="Detail" id="53">
46+ <barButtonItem key="rightBarButtonItem" systemItem="edit" id="9dq-bI-Dm0">
47+ <connections>
48+ <segue destination="rXN-9x-iCW" kind="modal" identifier="editNote" id="Kjf-1o-2Ik"/>
49+ </connections>
50+ </barButtonItem>
51+ </navigationItem>
4652 <connections>
47- <outlet property="detailText" destination="I5K-hl-l4m" id="Mze-kK-DLs"/>
53+ <outlet property="text" destination="I5K-hl-l4m" id="efg-OY-fpX"/>
4854 </connections>
4955 </viewController>
5056 </objects>
51- <point key="canvasLocation" x="448" y="248"/>
57+ <point key="canvasLocation" x="1025" y="-1397"/>
5258 </scene>
5359 <!--Split View Controller-->
5460 <scene sceneID="18">
@@ -64,7 +70,7 @@
6470 </connections>
6571 </splitViewController>
6672 </objects>
67- <point key="canvasLocation" x="-687" y="-630"/>
73+ <point key="canvasLocation" x="-1135" y="-950"/>
6874 </scene>
6975 <!--Master View Controller - Master-->
7076 <scene sceneID="24">
@@ -103,10 +109,55 @@
103109 <outlet property="delegate" destination="19" id="21"/>
104110 </connections>
105111 </tableView>
106- <navigationItem key="navigationItem" title="Master" id="40"/>
112+ <navigationItem key="navigationItem" title="Master" id="40">
113+ <barButtonItem key="rightBarButtonItem" systemItem="add" id="J5P-yO-cEM">
114+ <connections>
115+ <segue destination="rXN-9x-iCW" kind="modal" identifier="newNote" id="pK5-mO-z6F"/>
116+ </connections>
117+ </barButtonItem>
118+ </navigationItem>
107119 </tableViewController>
108120 </objects>
109- <point key="canvasLocation" x="859" y="-631"/>
121+ <point key="canvasLocation" x="527" y="-495"/>
122+ </scene>
123+ <!--Edit View Controller-->
124+ <scene sceneID="iZX-2r-fjn">
125+ <objects>
126+ <placeholder placeholderIdentifier="IBFirstResponder" id="5BA-Ef-J8x" userLabel="First Responder" sceneMemberID="firstResponder"/>
127+ <viewController id="bDQ-AH-j4Y" customClass="EditViewController" sceneMemberID="viewController">
128+ <view key="view" contentMode="scaleToFill" id="5tE-qu-kqz">
129+ <rect key="frame" x="0.0" y="64" width="1024" height="704"/>
130+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
131+ <subviews>
132+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" id="si7-dS-nro">
133+ <rect key="frame" x="0.0" y="0.0" width="1024" height="704"/>
134+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
135+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
136+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
137+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
138+ </textView>
139+ </subviews>
140+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
141+ <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
142+ </view>
143+ <navigationItem key="navigationItem" id="sUV-LL-8ot">
144+ <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="eka-xh-Nup">
145+ <connections>
146+ <action selector="cancel:" destination="bDQ-AH-j4Y" id="Nwu-CN-MDQ"/>
147+ </connections>
148+ </barButtonItem>
149+ <barButtonItem key="rightBarButtonItem" systemItem="done" id="Wbk-WE-vas">
150+ <connections>
151+ <action selector="done:" destination="bDQ-AH-j4Y" id="PR7-VL-kO8"/>
152+ </connections>
153+ </barButtonItem>
154+ </navigationItem>
155+ <connections>
156+ <outlet property="detailText" destination="si7-dS-nro" id="Cyl-Qi-jTW"/>
157+ </connections>
158+ </viewController>
159+ </objects>
160+ <point key="canvasLocation" x="1994" y="490"/>
110161 </scene>
111162 <!--Navigation Controller-->
112163 <scene sceneID="50">
@@ -121,12 +172,52 @@
121172 </connections>
122173 </navigationController>
123174 </objects>
124- <point key="canvasLocation" x="-366" y="248"/>
175+ <point key="canvasLocation" x="116" y="-1397"/>
176+ </scene>
177+ <!--Navigation Controller-->
178+ <scene sceneID="rOf-2X-6ce">
179+ <objects>
180+ <placeholder placeholderIdentifier="IBFirstResponder" id="JBX-0N-sNc" userLabel="First Responder" sceneMemberID="firstResponder"/>
181+ <navigationController id="rXN-9x-iCW" sceneMemberID="viewController">
182+ <toolbarItems/>
183+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="iYu-AH-jaY">
184+ <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
185+ <autoresizingMask key="autoresizingMask"/>
186+ </navigationBar>
187+ <nil name="viewControllers"/>
188+ <connections>
189+ <segue destination="bDQ-AH-j4Y" kind="relationship" relationship="rootViewController" id="HpA-Et-NYA"/>
190+ </connections>
191+ </navigationController>
192+ </objects>
193+ <point key="canvasLocation" x="1025" y="-494"/>
125194 </scene>
126195 </scenes>
196+ <classes>
197+ <class className="DetailViewController" superclassName="UIViewController">
198+ <source key="sourceIdentifier" type="project" relativePath="./Classes/DetailViewController.h"/>
199+ <relationships>
200+ <relationship kind="outlet" name="text" candidateClass="UITextView"/>
201+ </relationships>
202+ </class>
203+ <class className="EditViewController" superclassName="UIViewController">
204+ <source key="sourceIdentifier" type="project" relativePath="./Classes/EditViewController.h"/>
205+ <relationships>
206+ <relationship kind="action" name="cancel:"/>
207+ <relationship kind="action" name="done:"/>
208+ <relationship kind="outlet" name="detailText" candidateClass="UITextView"/>
209+ </relationships>
210+ </class>
211+ <class className="MasterViewController" superclassName="UITableViewController">
212+ <source key="sourceIdentifier" type="project" relativePath="./Classes/MasterViewController.h"/>
213+ </class>
214+ </classes>
127215 <simulatedMetricsContainer key="defaultSimulatedMetrics">
128216 <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
129217 <simulatedOrientationMetrics key="orientation"/>
130218 <simulatedScreenMetrics key="destination"/>
131219 </simulatedMetricsContainer>
220+ <inferredMetricsTieBreakers>
221+ <segue reference="Kjf-1o-2Ik"/>
222+ </inferredMetricsTieBreakers>
132223 </document>
\ No newline at end of file
--- a/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPhone.storyboard
+++ b/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPhone.storyboard
@@ -49,9 +49,6 @@
4949 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
5050 </view>
5151 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
52- <connections>
53- <segue destination="21" kind="custom" identifier="showDetail" customClass="CustomSegue" id="jZb-fq-zAk"/>
54- </connections>
5552 </tableViewCell>
5653 </prototypes>
5754 <sections/>
@@ -60,24 +57,30 @@
6057 <outlet property="delegate" destination="12" id="15"/>
6158 </connections>
6259 </tableView>
63- <navigationItem key="navigationItem" title="Master" id="36"/>
60+ <navigationItem key="navigationItem" title="Master" id="36">
61+ <barButtonItem key="rightBarButtonItem" systemItem="add" id="agb-4g-a59">
62+ <connections>
63+ <segue destination="7bR-lH-lJ9" kind="modal" identifier="newNote" id="HlC-by-ur5"/>
64+ </connections>
65+ </barButtonItem>
66+ </navigationItem>
6467 <connections>
65- <segue destination="21" kind="push" identifier="newNote" id="0ct-gM-2FR"/>
68+ <segue destination="7bR-lH-lJ9" kind="modal" identifier="editNote" id="aht-5S-Kxw"/>
6669 </connections>
6770 </tableViewController>
6871 </objects>
6972 <point key="canvasLocation" x="459" y="64"/>
7073 </scene>
71- <!--Detail View Controller - Detail-->
72- <scene sceneID="24">
74+ <!--Edit View Controller-->
75+ <scene sceneID="bJI-fW-9UV">
7376 <objects>
74- <placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
75- <viewController storyboardIdentifier="" title="Detail" id="21" customClass="DetailViewController" sceneMemberID="viewController">
76- <view key="view" contentMode="scaleToFill" id="22">
77+ <placeholder placeholderIdentifier="IBFirstResponder" id="dlo-yF-tdt" userLabel="First Responder" sceneMemberID="firstResponder"/>
78+ <viewController id="Rsp-rs-tJf" customClass="EditViewController" sceneMemberID="viewController">
79+ <view key="view" contentMode="scaleToFill" id="ZAM-9z-zxC">
7780 <rect key="frame" x="0.0" y="64" width="320" height="416"/>
7881 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
7982 <subviews>
80- <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="dcM-3R-DB6">
83+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="Xrk-0H-B8o">
8184 <rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
8285 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
8386 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
@@ -87,19 +90,50 @@
8790 </subviews>
8891 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
8992 </view>
90- <navigationItem key="navigationItem" title="Detail" id="26"/>
93+ <navigationItem key="navigationItem" id="euJ-qc-bbH">
94+ <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="kPQ-0x-DwA">
95+ <connections>
96+ <action selector="cancel:" destination="Rsp-rs-tJf" id="JJ8-d2-ftv"/>
97+ </connections>
98+ </barButtonItem>
99+ <barButtonItem key="rightBarButtonItem" systemItem="done" id="5xl-w3-ddR">
100+ <connections>
101+ <action selector="done:" destination="Rsp-rs-tJf" id="R7k-Mi-Ig3"/>
102+ </connections>
103+ </barButtonItem>
104+ </navigationItem>
91105 <connections>
92- <outlet property="detailText" destination="dcM-3R-DB6" id="xjt-Km-MjC"/>
106+ <outlet property="detailText" destination="Xrk-0H-B8o" id="hTl-cP-FEX"/>
93107 </connections>
94108 </viewController>
95109 </objects>
96- <point key="canvasLocation" x="902" y="64"/>
110+ <point key="canvasLocation" x="1350" y="64"/>
111+ </scene>
112+ <!--Navigation Controller-->
113+ <scene sceneID="a6N-vh-sA4">
114+ <objects>
115+ <placeholder placeholderIdentifier="IBFirstResponder" id="aKO-h7-hUd" userLabel="First Responder" sceneMemberID="firstResponder"/>
116+ <navigationController id="7bR-lH-lJ9" sceneMemberID="viewController">
117+ <toolbarItems/>
118+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="cJU-5A-2mE">
119+ <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
120+ <autoresizingMask key="autoresizingMask"/>
121+ </navigationBar>
122+ <nil name="viewControllers"/>
123+ <connections>
124+ <segue destination="Rsp-rs-tJf" kind="relationship" relationship="rootViewController" id="1U0-Gk-BfO"/>
125+ </connections>
126+ </navigationController>
127+ </objects>
128+ <point key="canvasLocation" x="891" y="64"/>
97129 </scene>
98130 </scenes>
99131 <classes>
100- <class className="DetailViewController" superclassName="UIViewController">
101- <source key="sourceIdentifier" type="project" relativePath="./Classes/DetailViewController.h"/>
132+ <class className="EditViewController" superclassName="UIViewController">
133+ <source key="sourceIdentifier" type="project" relativePath="./Classes/EditViewController.h"/>
102134 <relationships>
135+ <relationship kind="action" name="cancel:"/>
136+ <relationship kind="action" name="done:"/>
103137 <relationship kind="outlet" name="detailText" candidateClass="UITextView"/>
104138 </relationships>
105139 </class>
@@ -113,6 +147,6 @@
113147 <simulatedScreenMetrics key="destination"/>
114148 </simulatedMetricsContainer>
115149 <inferredMetricsTieBreakers>
116- <segue reference="0ct-gM-2FR"/>
150+ <segue reference="aht-5S-Kxw"/>
117151 </inferredMetricsTieBreakers>
118152 </document>
\ No newline at end of file
Show on old repository browser