diff options
author | Vitaly Takmazov | 2018-03-04 11:50:14 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-03-04 11:50:22 +0300 |
commit | a04f0db29cb280eb45888d3a56967cf9adc6214d (patch) | |
tree | b1625107b75a906b7b402296b3a93ca11a578633 /Juick/Views/BubbleMessageCell.m | |
parent | 782219f3cdc8cac644cc33657813a5f8319dbae7 (diff) |
ChatViewController
Diffstat (limited to 'Juick/Views/BubbleMessageCell.m')
-rw-r--r-- | Juick/Views/BubbleMessageCell.m | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Juick/Views/BubbleMessageCell.m b/Juick/Views/BubbleMessageCell.m new file mode 100644 index 0000000..b201664 --- /dev/null +++ b/Juick/Views/BubbleMessageCell.m @@ -0,0 +1,43 @@ +// +// BubbleMessageCell.m +// Juick +// +// Created by Vitaly Takmazov on 04/03/2018. +// Copyright © 2018 com.juick. All rights reserved. +// + +#import "BubbleMessageCell.h" +#import "ColorScheme.h" +@import YYWebImage; + +@implementation BubbleMessageCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +-(void) configureWithMessage:(Message *)message { + self.name.text = message.user.uname; + self.message.text = message.text; + self.unreadMarker.text = @""; + [self.avatarView yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [message.user.uid intValue]]] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation]; + self.message.enabledTextCheckingTypes = NSTextCheckingTypeLink; + self.message.backgroundColor = [ColorScheme mainBackground]; + self.message.layer.cornerRadius = 4; + self.message.clipsToBounds = YES; + self.message.textInsets = UIEdgeInsetsMake(4.0f, 8.0f, 4.0f, 8.0f); +} + +-(void) attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url { + [[UIApplication sharedApplication] openURL:url options: + @{} completionHandler:nil]; +} + +@end |