redribben

mas3

Feb 3rd, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (NSMutableAttributedString *)infoText:(NSIndexPath *)indexPath {
  2.     id specificSetting = [tableCellArray objectAtIndex:indexPath.row];
  3.    
  4.     NSAttributedString *dblSpc = [[NSAttributedString alloc] initWithString:@"\n\n" attributes:@{ NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] }];
  5.     //    [dblSpc addAttribute:NSFontAttributeName value:[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] range:NSMakeRange(0, dblSpc.length)];
  6.    
  7.    
  8.     NSMutableAttributedString *cellInfoDetail = [[NSMutableAttributedString alloc] initWithString:[specificSetting detail]];
  9.     [cellInfoDetail addAttribute:NSFontAttributeName
  10.                            value:[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]
  11.                            range:NSMakeRange(0, cellInfoDetail.length)];
  12.     [cellInfoDetail addAttribute:NSForegroundColorAttributeName
  13.                            value:[UIColor blackColor]
  14.                            range:NSMakeRange(0, cellInfoDetail.length)];
  15.    
  16.     NSMutableAttributedString *cellInfoSetOn = [[NSMutableAttributedString alloc] initWithString:[specificSetting setOn]];
  17.     [cellInfoSetOn addAttribute:NSFontAttributeName
  18.                           value:[UIFont preferredFontForTextStyle:UIFontTextStyleBody]
  19.                           range:NSMakeRange(0, cellInfoSetOn.length)];
  20.     [cellInfoSetOn addAttribute:NSForegroundColorAttributeName
  21.                           value:[self checkOnColor:indexPath.row]
  22.                           range:NSMakeRange(0, cellInfoSetOn.length)];
  23.    
  24.     NSMutableAttributedString *cellInfoSetOff = [[NSMutableAttributedString alloc] initWithString:[specificSetting setOff]];
  25.     [cellInfoSetOff addAttribute:NSFontAttributeName
  26.                            value:[UIFont preferredFontForTextStyle:UIFontTextStyleBody]
  27.                            range:NSMakeRange(0, cellInfoSetOff.length)];
  28.     [cellInfoSetOff addAttribute:NSForegroundColorAttributeName
  29.                            value:[self checkOffColor:indexPath.row]
  30.                            range:NSMakeRange(0, cellInfoSetOff.length)];
  31.    
  32.    
  33.     NSMutableAttributedString *infoText = [[NSMutableAttributedString alloc] init];
  34.     [infoText appendAttributedString:cellInfoDetail];
  35.     [infoText appendAttributedString:dblSpc];
  36.     [infoText appendAttributedString:cellInfoSetOn];
  37.     [infoText appendAttributedString:dblSpc];
  38.     [infoText appendAttributedString:cellInfoSetOff];
  39.    
  40. //    NSLog(@"infoText");
  41.  
  42.     return infoText;
Advertisement
Add Comment
Please, Sign In to add comment