// // YMFriendsViewModel.m // MSYOUPAI // // Created by YoMi on 2024/3/1. // Copyright © 2024 MS. All rights reserved. // #import "YMFriendsViewModel.h" @interface YMFriendsViewModel () /// 默认选中下标 @property (nonatomic, assign, readwrite) NSInteger defaultSelectedIndex; /// 好友ViewModel列表 @property (nonatomic, strong, readwrite) NSArray *friendsVMListDataArray; /// 关注VM @property (nonatomic, strong) YMFriendsListViewModel *followVM; /// 粉丝VM @property (nonatomic, strong) YMFriendsListViewModel *fansVM; @end @implementation YMFriendsViewModel - (void)ym_initialize{ [super ym_initialize]; self.customNavTitle = @"好友"; self.defaultSelectedIndex = [self.params integerValueForKey:@"defaultIndex" defaultValue:0]; self.friendsVMListDataArray = @[ self.followVM, self.fansVM, ]; } - (YMFriendsListViewModel *)followVM{ if (!_followVM) { _followVM = [[YMFriendsListViewModel alloc]initWithParams:@{ ParamsCategoryType:@(YMFriendsCategoryTypeFollow) }]; } return _followVM; } - (YMFriendsListViewModel *)fansVM{ if (!_fansVM) { _fansVM = [[YMFriendsListViewModel alloc]initWithParams:@{ ParamsCategoryType:@(YMFriendsCategoryTypeFans) }]; } return _fansVM; } @end