Нет описания

FKRecommendPageViewModel.m 808B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // FKRecommendPageViewModel.m
  3. // FirstLink
  4. //
  5. // Created by jack on 15/12/9.
  6. // Copyright © 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "FKRecommendPageViewModel.h"
  9. #import "FKRecommendController.h"
  10. #import "FKRecommendReform.h"
  11. @implementation FKRecommendPageViewModel
  12. - (FKRecommendPageItem *)pageItemAtIndex:(NSInteger)index{
  13. if (index >= 0 && index < self.pageItemArray.count) {
  14. return self.pageItemArray[index];
  15. }
  16. return nil;
  17. }
  18. - (NSArray *)sectionTitlesArray {
  19. if (self.pageItemArray.count == 0) {
  20. return @[@"精选"];
  21. }
  22. NSMutableArray *mutableArray = [NSMutableArray arrayWithObject:@"精选"];
  23. for (FKRecommendPageItem *item in self.pageItemArray) {
  24. [mutableArray addObject:item.pageName];
  25. }
  26. return mutableArray;
  27. }
  28. @end