car in 場站查車鎖車 ios
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

78 行
2.4KB

  1. //
  2. // HelpInfoViewController.m
  3. // goodpk
  4. //
  5. // Created by 歐特儀 on 2020/2/11.
  6. // Copyright © 2020 Altob. All rights reserved.
  7. //
  8. #import "HelpInfoViewController.h"
  9. @interface HelpInfoViewController ()
  10. @property (weak, nonatomic) IBOutlet UIButton *helpBtn;
  11. @end
  12. @implementation HelpInfoViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. // Do any additional setup after loading the view.
  16. self.title = @"緊急協助";
  17. [self.helpBtn addTarget:self
  18. action:@selector(handleButtonClicked:)
  19. forControlEvents:UIControlEventTouchUpInside
  20. ];
  21. }
  22. - (void) handleButtonClicked:(id)sender {
  23. [self showAlert:@"重要" :@"確定撥打管理室電話?" :nil];
  24. }
  25. -(void) callNumber:(NSString *)phoneNum{
  26. NSString *telephoneNumber = phoneNum;
  27. NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",telephoneNumber];
  28. UIApplication *application = [UIApplication sharedApplication];
  29. NSURL *URL = [NSURL URLWithString:str];
  30. [application openURL:URL options:@{} completionHandler:^(BOOL success) {
  31. //OpenSuccess=选择 呼叫 为 1 选择 取消 为0
  32. //NSLog(@"OpenSuccess=%d",success);
  33. }];
  34. }
  35. -(void)showAlert:(NSString *)title :(NSString *)text: (NSInteger *)type{
  36. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
  37. message:text
  38. preferredStyle:UIAlertControllerStyleAlert ];
  39. UIAlertAction *sinupAction = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
  40. [self callNumber:@"0229647078"];
  41. }];
  42. [alertController addAction:sinupAction];
  43. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
  44. }];
  45. [alertController addAction:cancelAction];
  46. [self presentViewController:alertController animated:YES completion:nil];
  47. }
  48. /*
  49. #pragma mark - Navigation
  50. // In a storyboard-based application, you will often want to do a little preparation before navigation
  51. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  52. // Get the new view controller using [segue destinationViewController].
  53. // Pass the selected object to the new view controller.
  54. }
  55. */
  56. @end