RQProfileUserAndVipItemViewModel.m 839 B

12345678910111213141516171819202122232425262728
  1. //
  2. // RQProfileUserAndVipItemViewModel.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/4/26.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQProfileUserAndVipItemViewModel.h"
  9. @interface RQProfileUserAndVipItemViewModel ()
  10. @property (nonatomic, readwrite, strong) RQUserModel *userModel;
  11. @end
  12. @implementation RQProfileUserAndVipItemViewModel
  13. - (instancetype)initViewModelWithUser:(RQUserModel *)user {
  14. if (self = [super init]) {
  15. @weakify(self)
  16. self.userModel = user;
  17. [[RACObserve(RQ_COMMON_MANAGER, APP_SWITCH) takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id _Nullable x) {
  18. @strongify(self)
  19. self.itemSize = CGSizeMake(RQ_SCREEN_WIDTH, RQ_COMMON_MANAGER.APP_SWITCH? RQ_FIT_HORIZONTAL(158.f) : RQ_FIT_HORIZONTAL(328.f));
  20. }];
  21. }
  22. return self;
  23. }
  24. @end