cdts/xdts-ios 3/TreeHole/Code/Features/Profile/View/ProfilePhotoCell.m

49 lines
958 B
Mathematica
Raw Normal View History

2023-07-27 09:20:00 +08:00
//
// ProfilePhotoCell.m
// TreeHole
//
// Created by on 2022/6/3.
//
#import "ProfilePhotoCell.h"
NSString * const ProfilePhotoCellID = @"ProfilePhotoCellID";
@interface ProfilePhotoCell ()
@end
@implementation ProfilePhotoCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.imageView.frame = self.bounds;
}
- (void)setupUI {
PYImageView *imageView = [[PYImageView alloc] init];
imageView.backgroundColor = [UIColor clearColor];
self.imageView = imageView;
[self.contentView addSubview:imageView];
}
- (void)setPhoto:(ProfilePhoto *)photo {
_photo = photo;
2023-08-18 17:46:45 +08:00
if ([photo.url containsString:@".web"]) {
self.imageView.image = [UIImage imageNamed:@"TH_defalut_avatar"];
} else {
self.imageView.imageUrl = photo.url;
}
2023-07-27 09:20:00 +08:00
}
@end