Today's Menu  Portugal
journal and plan nutrition
Instance Methods | List of all members
UILabel(Y5GradientFace) Category Reference

#import <UILabel+Y5GradientFace.h>

Instance Methods

(void) - postAttributedText:
 

Detailed Description

Definition at line 13 of file UILabel+Y5GradientFace.h.

Method Documentation

◆ postAttributedText:()

- (void) postAttributedText: (NSString *)  txt

Definition at line 12 of file UILabel+Y5GradientFace.m.

12  :(NSString *)txt
13 {
14  [self setNumberOfLines:0];
15  if (nil == txt) {
16  [self setText:@"err"];
17  } else if ([self respondsToSelector:@selector(setAttributedText:)]) {
18  UIFont *herefont = [UIFont fontWithName:@"DamascusBold" size:12];
19  // [attributedString addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, [attributedString length])];
20  NSDictionary *attribs = @{
21  NSForegroundColorAttributeName: self.textColor,
22  NSFontAttributeName: herefont
23  };
24  NSMutableAttributedString *attributedText =
25  [[NSMutableAttributedString alloc] initWithString:txt
26  attributes:attribs];
27  [self setAttributedText:attributedText];
28  } else {
29  [self setText:txt];
30  }
31  [self setTextAlignment:NSTextAlignmentCenter];
32 }

The documentation for this category was generated from the following files: