1. #import "SubCategoryViewController.h"
  2. #import "UIImageView+AFNetworking.h"
  3. #import "ProgressHUD.h"
  4. #import <SDWebImage/UIImageView+WebCache.h>
  5. #import "GAI.h"
  6. #import "GAIFields.h"
  7. #import "GAIDictionaryBuilder.h"
  8. #import "SubcategoryTableViewCell.h"
  9. @interface SubCategoryViewController () <UIScrollViewDelegate>
  10. {
  11. UIRefreshControl *refreshControl;
  12. };
  13. @end
  14. @implementation SubCategoryViewController
  15. #pragma mark
  16. // -------------------------------------------------------------------------------
  17. // viewDidLoad
  18. // -------------------------------------------------------------------------------
  19. - (void)viewDidLoad
  20. {
  21. [super viewDidLoad];
  22. [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
  23. }
  24. - (void)viewDidAppear:(BOOL)animated
  25. {
  26. }
  27. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  28. {
  29. return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  30. }
  31. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  32. {
  33. NSUInteger count = [self.entries count];
  34. return count;
  35. }
  36. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  37. {
  38. NSString *reuseIdentifier = [NSString stringWithFormat:@"cell_%ld",(long)indexPath.row];
  39. SubcategoryTableViewCell * sctvCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
  40. if (sctvCell == nil) {
  41. sctvCell= [[SubcategoryTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
  42. }
  43. NSUInteger nodeCount = [self.entries count];
  44. sctvCell.contentView.translatesAutoresizingMaskIntoConstraints = NO;
  45. if (nodeCount > 0)
  46. {
  47. sctvCell.label.hidden = false;
  48. [sctvCell.label setText:appRecord.title];
  49. }
  50. return sctvCell;
  51. }
  52. - (void)viewWillAppear:(BOOL)animated
  53. {
  54. [super viewWillAppear:animated];
  55. }
  56. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  57. {
  58. return 170;
  59. }
  60. - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
  61. {
  62. }
  63. @end