YMFriendsViewModel.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // YMFriendsViewModel.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/3/1.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMFriendsViewModel.h"
  9. @interface YMFriendsViewModel ()
  10. /// 默认选中下标
  11. @property (nonatomic, assign, readwrite) NSInteger defaultSelectedIndex;
  12. /// 好友ViewModel列表
  13. @property (nonatomic, strong, readwrite) NSArray <YMFriendsListViewModel *>*friendsVMListDataArray;
  14. /// 关注VM
  15. @property (nonatomic, strong) YMFriendsListViewModel *followVM;
  16. /// 粉丝VM
  17. @property (nonatomic, strong) YMFriendsListViewModel *fansVM;
  18. @end
  19. @implementation YMFriendsViewModel
  20. - (void)ym_initialize{
  21. [super ym_initialize];
  22. self.customNavTitle = @"好友";
  23. self.defaultSelectedIndex = [self.params integerValueForKey:@"defaultIndex" defaultValue:0];
  24. self.friendsVMListDataArray = @[
  25. self.followVM,
  26. self.fansVM,
  27. ];
  28. }
  29. - (YMFriendsListViewModel *)followVM{
  30. if (!_followVM) {
  31. _followVM = [[YMFriendsListViewModel alloc]initWithParams:@{
  32. ParamsCategoryType:@(YMFriendsCategoryTypeFollow)
  33. }];
  34. }
  35. return _followVM;
  36. }
  37. - (YMFriendsListViewModel *)fansVM{
  38. if (!_fansVM) {
  39. _fansVM = [[YMFriendsListViewModel alloc]initWithParams:@{
  40. ParamsCategoryType:@(YMFriendsCategoryTypeFans)
  41. }];
  42. }
  43. return _fansVM;
  44. }
  45. @end