• R/O
  • HTTP
  • SSH
  • HTTPS

Tombo: Commit

TOMBO source code


Commit MetaInfo

Revision9b44253a759144537e915f99a4f7676f5c5c1a78 (tree)
Time2012-04-10 16:30:24
AuthorHirami <tomohisa.hirami@nift...>
CommiterHirami

Log Message

Change screen transition for iPhone.

Change to detail view when note is selected.

Change Summary

Incremental Difference

--- a/iOS/Tombo/Tombo/DetailViewController.m
+++ b/iOS/Tombo/Tombo/DetailViewController.m
@@ -24,12 +24,19 @@
2424 - (void)viewDidLoad
2525 {
2626 [super viewDidLoad];
27- // Do any additional setup after loading the view.
27+
28+ NSString *note = [Storage load:self.item.path];
29+ if (note == nil) {
30+ self.text.text = @"";
31+ } else {
32+ self.text.text = note;
33+ }
2834 }
2935
3036 - (void)viewDidUnload
3137 {
3238 [self setText:nil];
39+ [self setText:nil];
3340 [super viewDidUnload];
3441 // Release any retained subviews of the main view.
3542 }
@@ -53,11 +60,14 @@
5360 if (item.isNewItem) {
5461 self.text.text = @"";
5562 } else {
56- NSString *note = [Storage load:item.path];
57- if (note == nil) {
58- self.text.text = @"";
59- } else {
60- self.text.text = note;
63+ // On iPhone and call by segue, self.text is nil because view is not loaded yet.
64+ if (self.text) {
65+ NSString *note = [Storage load:item.path];
66+ if (note == nil) {
67+ self.text.text = @"";
68+ } else {
69+ self.text.text = note;
70+ }
6171 }
6272 }
6373 _item = item;
--- a/iOS/Tombo/Tombo/MasterViewController.m
+++ b/iOS/Tombo/Tombo/MasterViewController.m
@@ -267,8 +267,6 @@
267267 } else {
268268 if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
269269 self.detailViewController.item = item;
270- } else {
271- [self performSegueWithIdentifier:@"editNote" sender:self];
272270 }
273271 }
274272 }
@@ -287,6 +285,13 @@
287285 FileItem *item = [_objects objectAtIndex:indexPath.row];
288286 edit.detailItem = item;
289287 edit.delegate = self;
288+ } else if ([[segue identifier] isEqualToString:@"showNote"]) {
289+ DetailViewController *detail = [segue destinationViewController];
290+ self.detailViewController = detail;
291+ NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
292+ FileItem *item = [_objects objectAtIndex:indexPath.row];
293+ detail.item = item;
294+ detail.master = self;
290295 }
291296 }
292297
--- a/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPad.storyboard
+++ b/iOS/Tombo/Tombo/en.lproj/MainStoryboard_iPad.storyboard
@@ -157,7 +157,7 @@
157157 </connections>
158158 </viewController>
159159 </objects>
160- <point key="canvasLocation" x="1994" y="490"/>
160+ <point key="canvasLocation" x="3354" y="-494"/>
161161 </scene>
162162 <!--Navigation Controller-->
163163 <scene sceneID="50">
@@ -190,7 +190,7 @@
190190 </connections>
191191 </navigationController>
192192 </objects>
193- <point key="canvasLocation" x="1025" y="-494"/>
193+ <point key="canvasLocation" x="2029" y="-494"/>
194194 </scene>
195195 </scenes>
196196 <classes>
@@ -218,6 +218,6 @@
218218 <simulatedScreenMetrics key="destination"/>
219219 </simulatedMetricsContainer>
220220 <inferredMetricsTieBreakers>
221- <segue reference="Kjf-1o-2Ik"/>
221+ <segue reference="pK5-mO-z6F"/>
222222 </inferredMetricsTieBreakers>
223223 </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,6 +49,9 @@
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="6do-Ku-KAw" kind="push" identifier="showNote" id="DbI-0p-xOL"/>
54+ </connections>
5255 </tableViewCell>
5356 </prototypes>
5457 <sections/>
@@ -64,13 +67,45 @@
6467 </connections>
6568 </barButtonItem>
6669 </navigationItem>
67- <connections>
68- <segue destination="7bR-lH-lJ9" kind="modal" identifier="editNote" id="aht-5S-Kxw"/>
69- </connections>
7070 </tableViewController>
7171 </objects>
7272 <point key="canvasLocation" x="459" y="64"/>
7373 </scene>
74+ <!--Detail View Controller-->
75+ <scene sceneID="3lH-GX-fIb">
76+ <objects>
77+ <placeholder placeholderIdentifier="IBFirstResponder" id="cIX-zs-I45" userLabel="First Responder" sceneMemberID="firstResponder"/>
78+ <viewController id="6do-Ku-KAw" customClass="DetailViewController" sceneMemberID="viewController">
79+ <view key="view" contentMode="scaleToFill" id="qW1-9A-BDd">
80+ <rect key="frame" x="0.0" y="64" width="320" height="416"/>
81+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
82+ <subviews>
83+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" id="crV-57-ylY">
84+ <rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
85+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
86+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
87+ <string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
88+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
89+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
90+ <dataDetectorType key="dataDetectorTypes" link="YES"/>
91+ </textView>
92+ </subviews>
93+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
94+ </view>
95+ <navigationItem key="navigationItem" id="MC6-er-cO2">
96+ <barButtonItem key="rightBarButtonItem" systemItem="edit" id="BTM-H8-OPn">
97+ <connections>
98+ <segue destination="7bR-lH-lJ9" kind="modal" identifier="editNote" id="g14-rF-OtD"/>
99+ </connections>
100+ </barButtonItem>
101+ </navigationItem>
102+ <connections>
103+ <outlet property="text" destination="crV-57-ylY" id="HD7-qX-vzI"/>
104+ </connections>
105+ </viewController>
106+ </objects>
107+ <point key="canvasLocation" x="1005" y="-516"/>
108+ </scene>
74109 <!--Edit View Controller-->
75110 <scene sceneID="bJI-fW-9UV">
76111 <objects>
@@ -107,7 +142,7 @@
107142 </connections>
108143 </viewController>
109144 </objects>
110- <point key="canvasLocation" x="1350" y="64"/>
145+ <point key="canvasLocation" x="2021" y="64"/>
111146 </scene>
112147 <!--Navigation Controller-->
113148 <scene sceneID="a6N-vh-sA4">
@@ -125,15 +160,34 @@
125160 </connections>
126161 </navigationController>
127162 </objects>
128- <point key="canvasLocation" x="891" y="64"/>
163+ <point key="canvasLocation" x="1561" y="64"/>
129164 </scene>
130165 </scenes>
166+ <classes>
167+ <class className="DetailViewController" superclassName="UIViewController">
168+ <source key="sourceIdentifier" type="project" relativePath="./Classes/DetailViewController.h"/>
169+ <relationships>
170+ <relationship kind="outlet" name="text" candidateClass="UITextView"/>
171+ </relationships>
172+ </class>
173+ <class className="EditViewController" superclassName="UIViewController">
174+ <source key="sourceIdentifier" type="project" relativePath="./Classes/EditViewController.h"/>
175+ <relationships>
176+ <relationship kind="action" name="cancel:"/>
177+ <relationship kind="action" name="done:"/>
178+ <relationship kind="outlet" name="detailText" candidateClass="UITextView"/>
179+ </relationships>
180+ </class>
181+ <class className="MasterViewController" superclassName="UITableViewController">
182+ <source key="sourceIdentifier" type="project" relativePath="./Classes/MasterViewController.h"/>
183+ </class>
184+ </classes>
131185 <simulatedMetricsContainer key="defaultSimulatedMetrics">
132186 <simulatedStatusBarMetrics key="statusBar"/>
133187 <simulatedOrientationMetrics key="orientation"/>
134188 <simulatedScreenMetrics key="destination"/>
135189 </simulatedMetricsContainer>
136190 <inferredMetricsTieBreakers>
137- <segue reference="aht-5S-Kxw"/>
191+ <segue reference="g14-rF-OtD"/>
138192 </inferredMetricsTieBreakers>
139-</document>
193+</document>
\ No newline at end of file
Show on old repository browser