Skip to content

Instantly share code, notes, and snippets.

@dotrinh-DM
Created November 5, 2021 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotrinh-DM/d62e8a0727fa19f341eb12210a0e2a62 to your computer and use it in GitHub Desktop.
Save dotrinh-DM/d62e8a0727fa19f341eb12210a0e2a62 to your computer and use it in GitHub Desktop.
prevent cell text is too long iOS
//prevent cell.valueLabel.text is too long
if(self.screenWidthShare <= 320){
if (rightMarkString.length >= 6) {
rightMarkString = [NSString stringWithFormat:@"%@...", [rightMarkString substringToIndex:3]];
}
} else {
if (rightMarkString.length >= 17) {
rightMarkString = [NSString stringWithFormat:@"%@...", [rightMarkString substringToIndex:12]];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment