JDViewController.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // JDViewController.m
  3. // kneet2
  4. //
  5. // Created by Created by Jason Lee on 10/1/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "JDViewController.h"
  9. #import "CustomTableView.h"
  10. @interface JDViewController () {
  11. //groups, invite from sms,
  12. }
  13. @end
  14. #pragma mark - Class Definition
  15. @implementation JDViewController
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. // Do any additional setup after loading the view.
  19. [self initUIOnSuper];
  20. [self prepareViewDidLoadOnSuper];
  21. }
  22. - (void)initUIOnSuper {
  23. }
  24. - (void)prepareViewDidLoadOnSuper {
  25. }
  26. - (UIButton *)generateOptionButton {
  27. UIImage *image = [UIImage imageNamed:@"common_head_btn_more"];
  28. UIImage *imagePress = [UIImage imageNamed:@"common_head_btn_more_press"];
  29. CGRect btnFrame = CGRectMake(0, 0, image.size.width, image.size.height);
  30. UIButton *button = [[UIButton alloc] initWithFrame:btnFrame];
  31. button.tag = 9003;
  32. [button setImage:image forState:UIControlStateNormal];
  33. [button setImage:imagePress forState:UIControlStateHighlighted];
  34. [button addTarget:self action:@selector(toggleOption:) forControlEvents:UIControlEventTouchUpInside];
  35. UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
  36. self.navigationItem.rightBarButtonItem = item;
  37. return button;
  38. }
  39. - (void)toggleOption:(id)sender {
  40. }
  41. #pragma mark - Main Logic
  42. #pragma mark - UITableView DataSource & Delegate
  43. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  44. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  45. }
  46. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  47. // Remove seperator inset
  48. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  49. [cell setSeparatorInset:UIEdgeInsetsZero];
  50. }
  51. // Prevent the cell from inheriting the Table View's margin settings
  52. if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
  53. [cell setPreservesSuperviewLayoutMargins:NO];
  54. }
  55. // Explictly set your cell's layout margins
  56. if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
  57. [cell setLayoutMargins:UIEdgeInsetsZero];
  58. }
  59. }
  60. #pragma mark - UI Events
  61. #pragma mark - MemoryWarning
  62. - (void)didReceiveMemoryWarning
  63. {
  64. [super didReceiveMemoryWarning];
  65. // Dispose of any resources that can be recreated.
  66. }
  67. @end