RABaseViewController.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // RABaseViewController.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/1.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RABaseViewController.h"
  9. #import "UIView+Toast.h"
  10. @interface RABaseViewController ()
  11. @end
  12. @implementation RABaseViewController
  13. + (NSString *)storyboardID {
  14. return NSStringFromClass([self class]);
  15. }
  16. + (instancetype)viewControllerFromStoryboard {
  17. return nil;
  18. }
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. // Do any additional setup after loading the view.
  22. }
  23. - (void)didReceiveMemoryWarning {
  24. [super didReceiveMemoryWarning];
  25. // Dispose of any resources that can be recreated.
  26. }
  27. - (void)showAlertTilte:(NSString *)title message:(NSString *)msg {
  28. if (title.length == 0 && msg.length == 0) {
  29. return;
  30. }
  31. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
  32. UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  33. }];
  34. [alertVC addAction:okAction];
  35. [self presentViewController:alertVC animated:YES completion:nil];
  36. }
  37. - (void)showAlert:(NSString *)msg {
  38. if (msg.length == 0) {
  39. return;
  40. }
  41. [self.view makeToast:msg duration:2.0f position:CSToastPositionCenter];
  42. }
  43. @end