iOS AILinkBleSDK - 蓝牙SDK
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ViewController.m 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //
  2. // ViewController.m
  3. // AILinkBleSDKSourceCode
  4. //
  5. // Created by iot_user on 2020/4/7.
  6. // Copyright © 2020 IOT. All rights reserved.
  7. //
  8. #import "ViewController.h"
  9. #import "Masonry.h"
  10. #import "AiLinkSuperViewController.h"
  11. #import "InheritScanViewController.h"
  12. #import "BabyScaleViewController.h"
  13. #import "BloodScanViewController.h"
  14. #import "HeightGuageScanViewController.h"
  15. #import "RemoteControlScanViewController.h"
  16. #import "ForeheadScanViewController.h"
  17. #import "ThermometerScanViewController.h"
  18. #import "WheelMonitorScanViewController.h"
  19. #import "BodyFatScaleScanViewController.h"
  20. #import "BroadcastScaleViewController.h"
  21. #import "EightScaleScanViewController.h"
  22. #import "ToothbrushScanViewController.h"
  23. @interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
  24. @property (nonatomic, strong) UITableView *tableView;
  25. @property (nonatomic, copy) NSArray *datas;
  26. @end
  27. @implementation ViewController
  28. - (void)viewDidLoad {
  29. [super viewDidLoad];
  30. self.datas = @[@"自己写协议走透传",@"有AILink协议自己解析数据",@"集成婴儿秤",@"集成血压计",@"集成身高仪",@"集成遥控器",@"集成额温枪",@"集成温度计",@"集成胎压监测",@"集成体脂秤",@"集成广播秤",@"八电极体脂秤",@"蓝牙WiFi牙刷"];
  31. [self.view addSubview:self.tableView];
  32. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.top.left.right.bottom.mas_equalTo(0);
  34. }];
  35. }
  36. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  37. return self.datas.count;
  38. }
  39. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  40. return 50;
  41. }
  42. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  43. static NSString *cellId = @"cellid";
  44. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
  45. if (!cell) {
  46. cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
  47. }
  48. cell.textLabel.text = self.datas[indexPath.row];
  49. return cell;
  50. }
  51. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  52. if (indexPath.row == 0) {
  53. AiLinkSuperViewController *vc = [[AiLinkSuperViewController alloc] init];
  54. vc.title = self.datas[indexPath.row];
  55. [self.navigationController pushViewController:vc animated:YES];
  56. }else if (indexPath.row == 1){
  57. InheritScanViewController *vc = [[InheritScanViewController alloc] init];
  58. vc.title = self.datas[indexPath.row];
  59. [self.navigationController pushViewController:vc animated:YES];
  60. }else if (indexPath.row == 2){
  61. BabyScaleViewController *vc = [[BabyScaleViewController alloc] init];
  62. vc.title = self.datas[indexPath.row];
  63. [self.navigationController pushViewController:vc animated:YES];
  64. }else if (indexPath.row == 3){
  65. BloodScanViewController *vc = [[BloodScanViewController alloc] init];
  66. vc.title = self.datas[indexPath.row];
  67. [self.navigationController pushViewController:vc animated:YES];
  68. }else if(indexPath.row == 4){
  69. HeightGuageScanViewController *vc = [[HeightGuageScanViewController alloc] init];
  70. vc.title = self.datas[indexPath.row];
  71. [self.navigationController pushViewController:vc animated:YES];
  72. }else if(indexPath.row == 5){
  73. RemoteControlScanViewController *vc = [[RemoteControlScanViewController alloc] init];
  74. vc.title = self.datas[indexPath.row];
  75. [self.navigationController pushViewController:vc animated:YES];
  76. }else if(indexPath.row == 6){
  77. ForeheadScanViewController *vc = [[ForeheadScanViewController alloc] init];
  78. vc.title = self.datas[indexPath.row];
  79. [self.navigationController pushViewController:vc animated:YES];
  80. }else if(indexPath.row == 7){
  81. ThermometerScanViewController *vc = [[ThermometerScanViewController alloc] init];
  82. vc.title = self.datas[indexPath.row];
  83. [self.navigationController pushViewController:vc animated:YES];
  84. }else if(indexPath.row == 8){
  85. WheelMonitorScanViewController *vc = [[WheelMonitorScanViewController alloc] init];
  86. vc.title = self.datas[indexPath.row];
  87. [self.navigationController pushViewController:vc animated:YES];
  88. }else if(indexPath.row == 9){
  89. BodyFatScaleScanViewController *vc = [[BodyFatScaleScanViewController alloc] init];
  90. vc.title = self.datas[indexPath.row];
  91. [self.navigationController pushViewController:vc animated:YES];
  92. }else if(indexPath.row == 10){
  93. BroadcastScaleViewController *vc = [[BroadcastScaleViewController alloc] init];
  94. vc.title = self.datas[indexPath.row];
  95. [self.navigationController pushViewController:vc animated:YES];
  96. }else if (indexPath.row == 11){
  97. EightScaleScanViewController *vc = [[EightScaleScanViewController alloc] init];
  98. vc.title = self.datas[indexPath.row];
  99. [self.navigationController pushViewController:vc animated:YES];
  100. }else if (indexPath.row == 12){
  101. ToothbrushScanViewController *vc = [[ToothbrushScanViewController alloc] init];
  102. vc.title = self.datas[indexPath.row];
  103. [self.navigationController pushViewController:vc animated:YES];
  104. }
  105. }
  106. -(UITableView *)tableView{
  107. if (_tableView == nil) {
  108. _tableView = [[UITableView alloc] init];
  109. _tableView.delegate = self;
  110. _tableView.dataSource = self;
  111. }
  112. return _tableView;
  113. }
  114. @end