Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

truncate text in RepoDetailsCell

  • Loading branch information...
commit 523a2bdf17667d632238e6dc49ceef7e7e441e85 1 parent ef2154d
Tri Vuong authored
BIN  Gitos-iPad.xcodeproj/project.xcworkspace/xcuserdata/trivuong.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
51 Gitos-iPad/Cells/RepoCell.xib
@@ -45,7 +45,6 @@
45 45 <int key="NSvFlags">292</int>
46 46 <string key="NSFrame">{{41, 9}, {426, 21}}</string>
47 47 <reference key="NSSuperview" ref="390018270"/>
48   - <reference key="NSWindow"/>
49 48 <reference key="NSNextKeyView" ref="552696292"/>
50 49 <string key="NSReuseIdentifierKey">_NS:9</string>
51 50 <bool key="IBUIOpaque">NO</bool>
@@ -81,7 +80,6 @@
81 80 <int key="NSvFlags">292</int>
82 81 <string key="NSFrame">{{594, 27}, {21, 14}}</string>
83 82 <reference key="NSSuperview" ref="390018270"/>
84   - <reference key="NSWindow"/>
85 83 <reference key="NSNextKeyView" ref="36814808"/>
86 84 <string key="NSReuseIdentifierKey">_NS:9</string>
87 85 <bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -96,7 +94,6 @@
96 94 <int key="NSvFlags">292</int>
97 95 <string key="NSFrame">{{619, 23}, {49, 21}}</string>
98 96 <reference key="NSSuperview" ref="390018270"/>
99   - <reference key="NSWindow"/>
100 97 <string key="NSReuseIdentifierKey">_NS:9</string>
101 98 <bool key="IBUIOpaque">NO</bool>
102 99 <bool key="IBUIClipsSubviews">YES</bool>
@@ -128,7 +125,6 @@
128 125 <int key="NSvFlags">292</int>
129 126 <string key="NSFrame">{{509, 25}, {16, 16}}</string>
130 127 <reference key="NSSuperview" ref="390018270"/>
131   - <reference key="NSWindow"/>
132 128 <reference key="NSNextKeyView" ref="619633788"/>
133 129 <string key="NSReuseIdentifierKey">_NS:9</string>
134 130 <bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -143,7 +139,6 @@
143 139 <int key="NSvFlags">292</int>
144 140 <string key="NSFrame">{{530, 23}, {49, 21}}</string>
145 141 <reference key="NSSuperview" ref="390018270"/>
146   - <reference key="NSWindow"/>
147 142 <reference key="NSNextKeyView" ref="680195919"/>
148 143 <string key="NSReuseIdentifierKey">_NS:9</string>
149 144 <bool key="IBUIOpaque">NO</bool>
@@ -167,7 +162,6 @@
167 162 <int key="NSvFlags">292</int>
168 163 <string key="NSFrame">{{41, 34}, {426, 21}}</string>
169 164 <reference key="NSSuperview" ref="390018270"/>
170   - <reference key="NSWindow"/>
171 165 <reference key="NSNextKeyView" ref="843529923"/>
172 166 <string key="NSReuseIdentifierKey">_NS:9</string>
173 167 <bool key="IBUIOpaque">NO</bool>
@@ -200,7 +194,6 @@
200 194 <int key="NSvFlags">292</int>
201 195 <string key="NSFrame">{{6, 9}, {30, 21}}</string>
202 196 <reference key="NSSuperview" ref="390018270"/>
203   - <reference key="NSWindow"/>
204 197 <reference key="NSNextKeyView" ref="370891270"/>
205 198 <string key="NSReuseIdentifierKey">_NS:9</string>
206 199 <bool key="IBUIOpaque">NO</bool>
@@ -231,7 +224,6 @@
231 224 </array>
232 225 <string key="NSFrameSize">{703, 66}</string>
233 226 <reference key="NSSuperview" ref="792805460"/>
234   - <reference key="NSWindow"/>
235 227 <reference key="NSNextKeyView" ref="636978850"/>
236 228 <string key="NSReuseIdentifierKey">_NS:11</string>
237 229 <object class="NSColor" key="IBUIBackgroundColor">
@@ -247,7 +239,6 @@
247 239 </array>
248 240 <string key="NSFrameSize">{703, 67}</string>
249 241 <reference key="NSSuperview"/>
250   - <reference key="NSWindow"/>
251 242 <reference key="NSNextKeyView" ref="390018270"/>
252 243 <string key="NSReuseIdentifierKey">_NS:9</string>
253 244 <string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -390,47 +381,7 @@
390 381 <nil key="sourceID"/>
391 382 <int key="maxID">21</int>
392 383 </object>
393   - <object class="IBClassDescriber" key="IBDocument.Classes">
394   - <array class="NSMutableArray" key="referencedPartialClassDescriptions">
395   - <object class="IBPartialClassDescription">
396   - <string key="className">RepoCell</string>
397   - <string key="superclassName">UITableViewCell</string>
398   - <dictionary class="NSMutableDictionary" key="outlets">
399   - <string key="descriptionLabel">UILabel</string>
400   - <string key="fontAwesomeLabel">UILabel</string>
401   - <string key="forkLabel">UILabel</string>
402   - <string key="repoNameLabel">UILabel</string>
403   - <string key="starLabel">UILabel</string>
404   - </dictionary>
405   - <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
406   - <object class="IBToOneOutletInfo" key="descriptionLabel">
407   - <string key="name">descriptionLabel</string>
408   - <string key="candidateClassName">UILabel</string>
409   - </object>
410   - <object class="IBToOneOutletInfo" key="fontAwesomeLabel">
411   - <string key="name">fontAwesomeLabel</string>
412   - <string key="candidateClassName">UILabel</string>
413   - </object>
414   - <object class="IBToOneOutletInfo" key="forkLabel">
415   - <string key="name">forkLabel</string>
416   - <string key="candidateClassName">UILabel</string>
417   - </object>
418   - <object class="IBToOneOutletInfo" key="repoNameLabel">
419   - <string key="name">repoNameLabel</string>
420   - <string key="candidateClassName">UILabel</string>
421   - </object>
422   - <object class="IBToOneOutletInfo" key="starLabel">
423   - <string key="name">starLabel</string>
424   - <string key="candidateClassName">UILabel</string>
425   - </object>
426   - </dictionary>
427   - <object class="IBClassDescriptionSource" key="sourceIdentifier">
428   - <string key="majorKey">IBProjectSource</string>
429   - <string key="minorKey">./Classes/RepoCell.h</string>
430   - </object>
431   - </object>
432   - </array>
433   - </object>
  384 + <object class="IBClassDescriber" key="IBDocument.Classes"/>
434 385 <int key="IBDocument.localizationMode">0</int>
435 386 <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
436 387 <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
7 Gitos-iPad/Cells/RepoDetailsCell.m
@@ -29,6 +29,11 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated
29 29 - (void)renderForIndexPath:(NSIndexPath *)indexPath
30 30 {
31 31 NSString *fieldLabelText = @"", *fieldValueText = @"";
  32 + NSString *homepage = [self.repo getHomepage];
  33 +
  34 + if (homepage.length >= REPO_DETAILS_MAX_CHARS) {
  35 + homepage = [[homepage substringToIndex:REPO_DETAILS_MAX_CHARS] stringByAppendingString:@"..."];
  36 + }
32 37
33 38 switch (indexPath.row) {
34 39 case 0:
@@ -37,7 +42,7 @@ - (void)renderForIndexPath:(NSIndexPath *)indexPath
37 42 break;
38 43 case 1:
39 44 fieldLabelText = @"Website";
40   - fieldValueText = [self.repo getHomepage];
  45 + fieldValueText = homepage;
41 46 break;
42 47 case 2:
43 48 fieldLabelText = @"Watchers";
5 Gitos-iPad/Cells/RepoDetailsCell.xib
@@ -42,7 +42,7 @@
42 42 <object class="IBUILabel" id="153751941">
43 43 <reference key="NSNextResponder" ref="1030391321"/>
44 44 <int key="NSvFlags">292</int>
45   - <string key="NSFrame">{{20, 11}, {128, 21}}</string>
  45 + <string key="NSFrame">{{20, 11}, {97, 21}}</string>
46 46 <reference key="NSSuperview" ref="1030391321"/>
47 47 <reference key="NSWindow"/>
48 48 <reference key="NSNextKeyView" ref="491140852"/>
@@ -80,7 +80,7 @@
80 80 <object class="IBUILabel" id="491140852">
81 81 <reference key="NSNextResponder" ref="1030391321"/>
82 82 <int key="NSvFlags">292</int>
83   - <string key="NSFrame">{{203, 11}, {784, 21}}</string>
  83 + <string key="NSFrame">{{156, 11}, {507, 21}}</string>
84 84 <reference key="NSSuperview" ref="1030391321"/>
85 85 <reference key="NSWindow"/>
86 86 <string key="NSReuseIdentifierKey">_NS:9</string>
@@ -96,6 +96,7 @@
96 96 </object>
97 97 <reference key="IBUIHighlightedColor" ref="589319003"/>
98 98 <int key="IBUIBaselineAdjustment">0</int>
  99 + <int key="IBUILineBreakMode">1</int>
99 100 <object class="IBUIFontDescription" key="IBUIFontDescription">
100 101 <string key="name">ArialMT</string>
101 102 <string key="family">Arial</string>
1  Gitos-iPad/Classes/GitosConstants.h
@@ -14,5 +14,6 @@ extern const NSString *CLIENT_ID;
14 14 extern const NSString *CLIENT_SECRET;
15 15 extern NSString * const LOADING_MESSAGE;
16 16 extern const float HIDE_AFTER;
  17 +extern const int REPO_DETAILS_MAX_CHARS;
17 18
18 19 @end
1  Gitos-iPad/Classes/GitosConstants.m
@@ -14,5 +14,6 @@ @implementation GitosConstants
14 14 const NSString *CLIENT_SECRET = @"07d3e053d06132245799f4afe45b90d2780a89a8";
15 15 NSString * const LOADING_MESSAGE = @"Loading";
16 16 const float HIDE_AFTER = 2.0f;
  17 +const int REPO_DETAILS_MAX_CHARS = 65;
17 18
18 19 @end

0 comments on commit 523a2bd

Please sign in to comment.
Something went wrong with that request. Please try again.