Created
August 30, 2014 16:17
-
-
Save rscarvalho/7cd210f47cbe77e48db0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSString *text = [publicacao.texto | |
| stringByTrimmingCharactersInSet:[NSCharacterSet | |
| whitespaceAndNewlineCharacterSet]]; | |
| self.textLabel.text = [text substringToIndex:MIN(text.length, 80)]; | |
| if (text.length > 80) { | |
| self.textLabel.text = [self.textLabel.text stringByAppendingString:@"..."]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| text = publicacao.texto.strip | |
| self.textLabel.text = text[0...([text.length, 80].min)] | |
| self.textLabel.text += "..." if text.length > 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment