You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Signal/src/views/ContactTableViewCell.m

45 lines
1.2 KiB
Matlab

11 years ago
#import "ContactTableViewCell.h"
#import "Environment.h"
#import "OWSContactAvatarBuilder.h"
#import "OWSContactsManager.h"
#import "PhoneManager.h"
#import "UIUtil.h"
NS_ASSUME_NONNULL_BEGIN
@interface ContactTableViewCell ()
11 years ago
@property (nonatomic) IBOutlet UILabel *nameLabel;
@property (nonatomic) IBOutlet UIImageView *avatarView;
@end
11 years ago
@implementation ContactTableViewCell
- (nullable NSString *)reuseIdentifier
{
return NSStringFromClass(self.class);
11 years ago
}
- (void)configureWithContact:(Contact *)contact contactsManager:(OWSContactsManager *)contactsManager
{
self.nameLabel.attributedText = [contactsManager formattedFullNameForContact:contact font:self.nameLabel.font];
self.avatarView.image =
[[[OWSContactAvatarBuilder alloc] initWithContactId:contact.textSecureIdentifiers.firstObject
name:contact.fullName
contactsManager:contactsManager] build];
// Force layout, since imageView isn't being initally rendered on App Store optimized build.
[self layoutSubviews];
}
- (void)layoutSubviews
{
[super layoutSubviews];
[UIUtil applyRoundedBorderToImageView:self.avatarView];
11 years ago
}
@end
NS_ASSUME_NONNULL_END