QMChatRoomCellFactory.m 941 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // QMChatRoomCellFactory.m
  3. // IMSDK-OC
  4. //
  5. // Created by HCF on 16/3/11.
  6. // Copyright © 2016年 HCF. All rights reserved.
  7. //
  8. #import "QMChatRoomCellFactory.h"
  9. #import "QMChatRoomBaseCell.h"
  10. #import "QMChatRoomTextCell.h"
  11. #import "QMChatRoomImageCell.h"
  12. #import "QMChatRoomVoiceCell.h"
  13. @implementation QMChatRoomCellFactory
  14. + (QMChatRoomBaseCell *)createCellWithClassName:(NSString *)className
  15. cellModel:(CustomMessage *)cellModel
  16. indexPath:(NSIndexPath *)indexPath {
  17. QMChatRoomBaseCell * cell = nil;
  18. Class cellClass = NSClassFromString(className);
  19. cell = [[cellClass alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:className];
  20. if (cell == nil) {
  21. cell = [[QMChatRoomBaseCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"QMChatRoomBaseCell"];
  22. }
  23. return cell;
  24. }
  25. @end