AIFit-SDK for ble body fat scale
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SetUserViewController.m 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // SetUserViewController.m
  3. // AIFit-Demo
  4. //
  5. // Created by steven wu on 2019/12/20.
  6. // Copyright © 2019 wujia121. All rights reserved.
  7. //
  8. #import "SetUserViewController.h"
  9. #import "AppUser.h"
  10. #import <InetBleSDK/InetBleSDK.h>
  11. @interface SetUserViewController ()
  12. @property (weak, nonatomic) IBOutlet UISegmentedControl *sexSegmentedC;
  13. @property (weak, nonatomic) IBOutlet UITextField *ageTextF;
  14. @property (weak, nonatomic) IBOutlet UITextField *heightTextF;
  15. @end
  16. @implementation SetUserViewController
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. _sexSegmentedC.selectedSegmentIndex = self.user.sex == 1 ? 0 : 1;
  20. _ageTextF.text = [NSString stringWithFormat:@"%d",self.user.age];
  21. _heightTextF.text = [NSString stringWithFormat:@"%d",self.user.height];
  22. }
  23. - (IBAction)saveUserInfo:(id)sender {
  24. _user.sex = _sexSegmentedC.selectedSegmentIndex == 0 ? 1 : 2; //male:1 female:2
  25. _user.age = _ageTextF.text.intValue;
  26. _user.height = _heightTextF.text.intValue;
  27. if (_editUserCallBack) {
  28. _editUserCallBack();
  29. }
  30. [self dismissViewControllerAnimated:YES completion:nil];
  31. }
  32. @end