YOUPAIZhaPianTextAttachment2.m 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // YOUPAIZhaPianTextAttachment2.m
  3. // YOUQU
  4. //
  5. // Created by xiaohaoran on 2021/12/14.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIZhaPianTextAttachment2.h"
  9. @implementation YOUPAIZhaPianTextAttachment2
  10. - (NSString *)encodeAttachment
  11. {
  12. NSDictionary *dict = @{
  13. CMType : @(CustomOnChatRoomHint),
  14. CMData : @{
  15. }
  16. };
  17. NSData *data = [NSJSONSerialization dataWithJSONObject:dict
  18. options:0
  19. error:nil];
  20. NSString *content = nil;
  21. if (data) {
  22. content = [[NSString alloc] initWithData:data
  23. encoding:NSUTF8StringEncoding];
  24. }
  25. return content;
  26. }
  27. - (NSString *)cellContent:(NIMMessage *)message{
  28. return @"YOUPAIZhaPianTextContentView2";
  29. }
  30. - (CGSize)contentSize:(NIMMessageModel *)model cellWidth:(CGFloat)width{
  31. CGFloat topTitleHeight =[@"温馨提示:凡涉及转账均为诈骗,切勿相信,若对方要求转账请立即举报" heightWithFont:[UIFont systemFontOfSize:12] padding:3.0 constrainedToWidth:KScreenWidth-50.0f];
  32. CGFloat currentY = topTitleHeight+5.0f;
  33. return CGSizeMake(KScreenWidth, currentY);
  34. }
  35. - (UIEdgeInsets)contentViewInsets:(NIMMessage *)message
  36. {
  37. return UIEdgeInsetsZero;
  38. }
  39. @end