Guest User

Untitled

a guest
Jan 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. [super viewDidLoad];
  4.  
  5. NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
  6. paragraphStyle.lineHeightMultiple = 50.f;
  7. paragraphStyle.lineSpacing = 100.f;
  8. paragraphStyle.minimumLineHeight = 200.f;
  9. paragraphStyle.maximumLineHeight = 500.f;
  10.  
  11. UIFont *font = [UIFont fontWithName:@"AmericanTypewriter" size:24.f];
  12.  
  13. self.textView.attributedText = [[NSAttributedString alloc] initWithString:
  14. @"This is a test.n Will I pass?" attributes:
  15. @{NSParagraphStyleAttributeName : paragraphStyle, NSFontAttributeName : font}];
  16. }
  17.  
  18. NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
  19. paragraphStyle.minimumLineHeight = 35.f;
  20. paragraphStyle.maximumLineHeight = 35.f;
  21.  
  22. UIFont *font = [UIFont fontWithName:@"AmericanTypewriter" size:18.f];
  23. NSString *string = @"This is a test.nWill I pass?n日本語のもじもあるEnglishnEnglish y Español";
  24. NSDictionary *attributtes = @{
  25. NSParagraphStyleAttributeName : paragraphStyle,
  26. };
  27. self.textView.font = font;
  28. self.textView.attributedText = [[NSAttributedString alloc] initWithString:string
  29. attributes:attributtes];
Add Comment
Please, Sign In to add comment