MsgSysModel.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // MsgSysModel.m
  3. // YBVideo
  4. //
  5. // Created by YunBao on 2018/8/2.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "MsgSysModel.h"
  9. @implementation MsgSysModel
  10. - (instancetype)initWithDic:(NSDictionary *)dic lisModel:(MessageListModel *)listModel{
  11. self = [super init];
  12. if (self) {
  13. _idStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"id"]];
  14. _uidStr = listModel.uidStr;
  15. _iconStr = listModel.iconStr;
  16. _titleStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"title"]];
  17. _timeStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"addtime"]];
  18. if ([listModel.uidStr isEqual:@"dsp_admin_1"]) {
  19. _briefStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"synopsis"]];
  20. _urlStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"url"]];
  21. }
  22. if ([listModel.uidStr isEqual:@"dsp_admin_2"]) {
  23. _contentStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"content"]];
  24. }
  25. //不再预先计算,选用cell自动计算行高(xib布局基本按照下面注释设置的约束)
  26. //[self setFrame];
  27. }
  28. return self;
  29. }
  30. -(void)setFrame {
  31. /** (xib布局基本按照下面注释设置的约束)
  32. * top 10
  33. * title 20
  34. * t-b-space 5
  35. * brief 计算
  36. * time-brief-space 10
  37. * time 16
  38. * bot 10
  39. * icon 42*42 内容高度>头像
  40. */
  41. }
  42. +(instancetype)modelWithDic:(NSDictionary *)dic lisModel:(MessageListModel *)listModel{
  43. return [[self alloc]initWithDic:dic lisModel:listModel];
  44. }
  45. @end