FreeRDP
Loading...
Searching...
No Matches
BookmarkTableCell.m
1/*
2 Custom bookmark table cell
3
4 Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9 */
10
11#import "BookmarkTableCell.h"
12
13@interface BookmarkTableCell (Private)
14- (void)updateContent;
15@end
16
17@implementation BookmarkTableCell
18
19@synthesize title = _title, subTitle = _sub_title;
20
21- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
22{
23 self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
24 if (self)
25 {
26 // Initialization code
27 [self setAccessoryType:UITableViewCellAccessoryDetailButton];
28 }
29 return self;
30}
31
32- (void)dealloc
33{
34 [_title release];
35 [_sub_title release];
36 [super dealloc];
37}
38
39- (void)setTitle:(NSString *)title
40{
41 if (_title != title)
42 {
43 [_title release];
44 _title = [title copy];
45 }
46
47 [self updateContent];
48}
49
50- (void)setSubTitle:(NSString *)subTitle
51{
52 if (_sub_title != subTitle)
53 {
54 [_sub_title release];
55 _sub_title = [subTitle copy];
56 }
57
58 [self updateContent];
59}
60
61- (void)updateContent
62{
63 UIListContentConfiguration *content = [UIListContentConfiguration subtitleCellConfiguration];
64 [content setText:_title];
65 [content setSecondaryText:_sub_title];
66 [[content secondaryTextProperties] setColor:[UIColor secondaryLabelColor]];
67 [self setContentConfiguration:content];
68}
69
70@end