Permalink
Browse files

truncate text in RepoDetailsCell

  • Loading branch information...
1 parent ef2154d commit 523a2bdf17667d632238e6dc49ceef7e7e441e85 @trivektor committed Mar 24, 2013
@@ -45,7 +45,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{41, 9}, {426, 21}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="552696292"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
@@ -81,7 +80,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{594, 27}, {21, 14}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="36814808"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -96,7 +94,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{619, 23}, {49, 21}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -128,7 +125,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{509, 25}, {16, 16}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="619633788"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -143,7 +139,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{530, 23}, {49, 21}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="680195919"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
@@ -167,7 +162,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{41, 34}, {426, 21}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="843529923"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
@@ -200,7 +194,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{6, 9}, {30, 21}}</string>
<reference key="NSSuperview" ref="390018270"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="370891270"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
@@ -231,7 +224,6 @@
</array>
<string key="NSFrameSize">{703, 66}</string>
<reference key="NSSuperview" ref="792805460"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="636978850"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<object class="NSColor" key="IBUIBackgroundColor">
@@ -247,7 +239,6 @@
</array>
<string key="NSFrameSize">{703, 67}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="390018270"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -390,47 +381,7 @@
<nil key="sourceID"/>
<int key="maxID">21</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">RepoCell</string>
- <string key="superclassName">UITableViewCell</string>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="descriptionLabel">UILabel</string>
- <string key="fontAwesomeLabel">UILabel</string>
- <string key="forkLabel">UILabel</string>
- <string key="repoNameLabel">UILabel</string>
- <string key="starLabel">UILabel</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="descriptionLabel">
- <string key="name">descriptionLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="fontAwesomeLabel">
- <string key="name">fontAwesomeLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="forkLabel">
- <string key="name">forkLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="repoNameLabel">
- <string key="name">repoNameLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="starLabel">
- <string key="name">starLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/RepoCell.h</string>
- </object>
- </object>
- </array>
- </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
@@ -29,6 +29,11 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated
- (void)renderForIndexPath:(NSIndexPath *)indexPath
{
NSString *fieldLabelText = @"", *fieldValueText = @"";
+ NSString *homepage = [self.repo getHomepage];
+
+ if (homepage.length >= REPO_DETAILS_MAX_CHARS) {
+ homepage = [[homepage substringToIndex:REPO_DETAILS_MAX_CHARS] stringByAppendingString:@"..."];
+ }
switch (indexPath.row) {
case 0:
@@ -37,7 +42,7 @@ - (void)renderForIndexPath:(NSIndexPath *)indexPath
break;
case 1:
fieldLabelText = @"Website";
- fieldValueText = [self.repo getHomepage];
+ fieldValueText = homepage;
break;
case 2:
fieldLabelText = @"Watchers";
@@ -42,7 +42,7 @@
<object class="IBUILabel" id="153751941">
<reference key="NSNextResponder" ref="1030391321"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 11}, {128, 21}}</string>
+ <string key="NSFrame">{{20, 11}, {97, 21}}</string>
<reference key="NSSuperview" ref="1030391321"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="491140852"/>
@@ -80,7 +80,7 @@
<object class="IBUILabel" id="491140852">
<reference key="NSNextResponder" ref="1030391321"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{203, 11}, {784, 21}}</string>
+ <string key="NSFrame">{{156, 11}, {507, 21}}</string>
<reference key="NSSuperview" ref="1030391321"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
@@ -96,6 +96,7 @@
</object>
<reference key="IBUIHighlightedColor" ref="589319003"/>
<int key="IBUIBaselineAdjustment">0</int>
+ <int key="IBUILineBreakMode">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">ArialMT</string>
<string key="family">Arial</string>
@@ -14,5 +14,6 @@ extern const NSString *CLIENT_ID;
extern const NSString *CLIENT_SECRET;
extern NSString * const LOADING_MESSAGE;
extern const float HIDE_AFTER;
+extern const int REPO_DETAILS_MAX_CHARS;
@end
@@ -14,5 +14,6 @@ @implementation GitosConstants
const NSString *CLIENT_SECRET = @"07d3e053d06132245799f4afe45b90d2780a89a8";
NSString * const LOADING_MESSAGE = @"Loading";
const float HIDE_AFTER = 2.0f;
+const int REPO_DETAILS_MAX_CHARS = 65;
@end

0 comments on commit 523a2bd

Please sign in to comment.