ScanServerListViewController.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // ScanServerListViewController.m
  3. // HMLG Scan Order
  4. //
  5. // Created by Rui Zhang on 4/2/22.
  6. // Copyright © 2022 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ScanServerListViewController.h"
  9. @interface ScanServerListViewController ()
  10. @end
  11. @implementation ScanServerListViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view.
  15. }
  16. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  17. return self.serverlist.count;
  18. }
  19. //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  20. // return 136.0f;
  21. //}
  22. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  23. {
  24. static NSString *MyIdentifier = @"Cell";
  25. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
  26. if (cell == nil)
  27. {
  28. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
  29. reuseIdentifier:MyIdentifier];
  30. }
  31. cell.textLabel.text = self.serverlist[indexPath.row][@"show_name"];
  32. return cell;
  33. }
  34. - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  35. if(self.returnValue)
  36. self.returnValue(indexPath.item);
  37. [[self navigationController]popViewControllerAnimated:true];
  38. // [self dismissViewControllerAnimated:TRUE completion:nil];
  39. }
  40. /*
  41. #pragma mark - Navigation
  42. // In a storyboard-based application, you will often want to do a little preparation before navigation
  43. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  44. // Get the new view controller using [segue destinationViewController].
  45. // Pass the selected object to the new view controller.
  46. }
  47. */
  48. @end