forked from Rightpoint/BonMot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TagStylesCell.m
41 lines (29 loc) · 1.01 KB
/
TagStylesCell.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// TagStylesCell.m
// BonMot
//
// Created by Nora Trapp on 3/3/16.
// Copyright © 2016 Zev Eisenberg. All rights reserved.
//
#import "TagStylesCell.h"
@interface TagStylesCell ()
@property (weak, nonatomic) IBOutlet UILabel *label;
@end
@implementation TagStylesCell
+ (NSString *)title
{
return @"Tag Styles";
}
- (void)awakeFromNib
{
[super awakeFromNib];
BONChain *boldChain = BONChain.new.fontNameAndSize(@"Baskerville-Bold", 15);
BONChain *italicChain = BONChain.new.fontNameAndSize(@"Baskerville-Italic", 15);
BONChain *baseChain = BONChain.new.fontNameAndSize(@"Baskerville", 17)
.tagStyles(@{ @"bold" : boldChain,
@"italic" : italicChain })
.string(@"<bold>This text</bold> contains a \\<bold> tag.\n<italic>This text</italic> contains an \\<italic> tag.");
self.label.attributedText = baseChain.attributedString;
[self.label layoutIfNeeded]; // For auto-sizing cells
}
@end