SmallToolViewController.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // SmallToolViewController.m
  3. // KulexiuForStudent
  4. //
  5. // Created by 王智 on 2022/10/13.
  6. //
  7. #import "SmallToolViewController.h"
  8. #import "WidgetViewController.h"
  9. #import "SmallToolBodyView.h"
  10. #import "ToneTuningViewController.h"
  11. @interface SmallToolViewController ()
  12. @end
  13. @implementation SmallToolViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. [self allocTitle:@"小工具"];
  18. [self configUI];
  19. }
  20. - (void)configUI {
  21. SmallToolBodyView *bodyView = [SmallToolBodyView shareInstance];
  22. bodyView.frame = CGRectMake(0, 0, KPortraitWidth, KPortraitHeight - kNaviBarHeight);
  23. [self.scrollView addSubview:bodyView];
  24. MJWeakSelf;
  25. [bodyView chooseToolCallback:^(TOOLTYPE type) {
  26. [weakSelf chooseToolFunction:type];
  27. }];
  28. }
  29. - (void)chooseToolFunction:(TOOLTYPE)type {
  30. switch (type) {
  31. case TOOLTYPE_METRONOME:
  32. {
  33. WidgetViewController *ctrl = [[WidgetViewController alloc] init];
  34. [self.navigationController pushViewController:ctrl animated:YES];
  35. }
  36. break;
  37. case TOOLTYPE_TONE:
  38. {
  39. ToneTuningViewController *ctrl = [[ToneTuningViewController alloc] init];
  40. [self.navigationController pushViewController:ctrl animated:YES];
  41. }
  42. break;
  43. default:
  44. break;
  45. }
  46. }
  47. /*
  48. #pragma mark - Navigation
  49. // In a storyboard-based application, you will often want to do a little preparation before navigation
  50. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  51. // Get the new view controller using [segue destinationViewController].
  52. // Pass the selected object to the new view controller.
  53. }
  54. */
  55. @end