12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //
- // NIMMessageCellMaker.m
- // NIMKit
- //
- // Created by chris.
- // Copyright (c) 2015年 NetEase. All rights reserved.
- //
- #import "NIMMessageCellFactory.h"
- #import "NIMMessageModel.h"
- #import "NIMTimestampModel.h"
- #import "NIMSessionAudioContentView.h"
- #import "NIMKit.h"
- #import "NIMKitAudioCenter.h"
- #import "UIView+NIM.h"
- @interface NIMMessageCellFactory()
- @end
- @implementation NIMMessageCellFactory
- - (instancetype)init
- {
- self = [super init];
- if (self) {
- }
- return self;
- }
- - (void)dealloc
- {
-
- }
- - (NIMMessageCell *)cellInTable:(UITableView*)tableView
- forMessageMode:(NIMMessageModel *)model
- {
- id<NIMCellLayoutConfig> layoutConfig = [[NIMKit sharedKit] layoutConfig];
- NSString *identity = [layoutConfig cellContent:model];
- NIMMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:identity];
- if (!cell) {
- NSString *clz = @"NIMMessageCell";
- [tableView registerClass:NSClassFromString(clz) forCellReuseIdentifier:identity];
- cell = [tableView dequeueReusableCellWithIdentifier:identity];
- }
- return (NIMMessageCell *)cell;
- }
- - (NIMSessionTimestampCell *)cellInTable:(UITableView *)tableView
- forTimeModel:(NIMTimestampModel *)model
- {
- NSString *identity = @"time";
- NIMSessionTimestampCell *cell = [tableView dequeueReusableCellWithIdentifier:identity];
- if (!cell) {
- NSString *clz = @"NIMSessionTimestampCell";
- [tableView registerClass:NSClassFromString(clz) forCellReuseIdentifier:identity];
- cell = [tableView dequeueReusableCellWithIdentifier:identity];
- }
- [cell refreshData:model];
- return (NIMSessionTimestampCell *)cell;
- }
- @end
|