summaryrefslogtreecommitdiff
path: root/Juick/MessageCell.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/MessageCell.m')
-rw-r--r--Juick/MessageCell.m11
1 files changed, 4 insertions, 7 deletions
diff --git a/Juick/MessageCell.m b/Juick/MessageCell.m
index 8c2f001..d2b2983 100644
--- a/Juick/MessageCell.m
+++ b/Juick/MessageCell.m
@@ -80,31 +80,28 @@
// Configure the view for the selected state
}
-- (CGRect) sizeForLabel:(UILabel *)label width:(CGFloat)width {
- return [label.text boundingRectWithSize:(CGSize) {width, CGFLOAT_MAX} options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:label.font} context:nil];
-}
- (CGRect) avatarRect {
return CGRectMake(kPaddingX, kPaddingY, kAvatarSizeX, kAvatarSizeY);
}
- (CGRect) bodyRect {
- CGRect bodySize = [self sizeForLabel:self.bodyLabel width:(self.contentView.bounds.size.width - kPaddingX * 2)];
+ CGRect bodySize = [UILabel sizeForLabel:self.bodyLabel width:(self.contentView.bounds.size.width - kPaddingX * 2)];
return CGRectMake(kPaddingX, kPaddingY + kAvatarSizeY + kPaddingY * 2, bodySize.size.width, bodySize.size.height);
}
- (CGRect) titleRect {
- CGRect titleSize = [self sizeForLabel:self.titleLabel width:self.contentView.bounds.size.width - [self avatarRect].size.width - kPaddingX * 2];
+ CGRect titleSize = [UILabel sizeForLabel:self.titleLabel width:self.contentView.bounds.size.width - [self avatarRect].size.width - kPaddingX * 2];
return CGRectMake(kPaddingX + kAvatarSizeX + kPaddingX, kPaddingY, titleSize.size.width, titleSize.size.height);
}
- (CGRect) timestampRect {
- CGRect timeStampSize = [self sizeForLabel:self.timestampLabel width:self.contentView.bounds.size.width - [self avatarRect].size.width - kPaddingX * 2];
+ CGRect timeStampSize = [UILabel sizeForLabel:self.timestampLabel width:self.contentView.bounds.size.width - [self avatarRect].size.width - kPaddingX * 2];
return CGRectMake(kPaddingX + [self avatarRect].size.width + kPaddingX, kPaddingY + [self titleRect].size.height + kPaddingY, timeStampSize.size.width, timeStampSize.size.height);
}
- (CGRect) summaryRect {
- CGRect summarySize = [self sizeForLabel:self.summaryLabel width:(self.contentView.bounds.size.width - 20)];
+ CGRect summarySize = [UILabel sizeForLabel:self.summaryLabel width:(self.contentView.bounds.size.width - 20)];
float summaryY = 10 + 32 + 10 + [self bodyRect].size.height + 10;
if (self.message.attach != nil) {
summaryY += [self attachRect].size.height + 10;