CPDFBatesSettingController.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // BatesSettingViewController.m
  3. // PDFViewer
  4. //
  5. // Created by kdanmobile_2 on 2022/11/17.
  6. //
  7. #import "CPDFBatesSettingController.h"
  8. @interface CPDFBatesSettingController ()
  9. @end
  10. @implementation CPDFBatesSettingController
  11. - (id)initWithIamge:(UIImage *)image WithSize:(CGSize)size {
  12. self = [super init];
  13. if (self) {
  14. _image = image;
  15. _size = size;
  16. }
  17. return self;
  18. }
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. // Do any additional setup after loading the view.
  22. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
  23. UIAlertAction *addBatesAction = [UIAlertAction actionWithTitle:@"Add Bates" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  24. self.batesAddControl = [[CPDFBatesAddViewController alloc] initWithIamge:self.image WithSize:self.size];
  25. [self addChildViewController:self.batesAddControl];
  26. [self.view addSubview:self.batesAddControl.view];
  27. [self.navigationController pushViewController:self.batesAddControl animated:NO];
  28. self.view.hidden = YES;
  29. }];
  30. UIAlertAction *delereBatesAction = [UIAlertAction actionWithTitle:@"Delete Bates" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  31. CPDFBatesDeleteViewController *batesDeleteControl = [[CPDFBatesDeleteViewController alloc] init];
  32. [self addChildViewController:batesDeleteControl];
  33. [self.view addSubview:batesDeleteControl.view];
  34. [self.navigationController pushViewController:batesDeleteControl animated:NO];
  35. }];
  36. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  37. NSLog(@"Cancel Action");
  38. }];
  39. [alertController addAction:addBatesAction];
  40. [alertController addAction:delereBatesAction];
  41. [alertController addAction:cancelAction];
  42. [self presentViewController:alertController animated:YES completion:nil];
  43. }
  44. @end