12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // BatesSettingViewController.m
- // PDFViewer
- //
- // Created by kdanmobile_2 on 2022/11/17.
- //
- #import "CPDFBatesSettingController.h"
- #import "CPDFBatesDeleteViewController.h"
- #import "CPDFBatesAddViewController.h"
- @interface CPDFBatesSettingController ()
- @end
- @implementation CPDFBatesSettingController
- - (id)initWithIamge:(UIImage *)image WithSize:(CGSize)size {
- self = [super init];
- if (self) {
- _image = image;
- _size = size;
- }
- return self;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
- UIAlertAction *addBatesAction = [UIAlertAction actionWithTitle:@"Add Bates" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- CPDFBatesAddViewController *batesAddControl = [[CPDFBatesAddViewController alloc] initWithIamge:self.image WithSize:self.size];
- [self addChildViewController:batesAddControl];
- [self.view addSubview:batesAddControl.view];
- [self.navigationController pushViewController:batesAddControl animated:NO];
- }];
- UIAlertAction *delereBatesAction = [UIAlertAction actionWithTitle:@"Delete Bates" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- CPDFBatesDeleteViewController *batesDeleteControl = [[CPDFBatesDeleteViewController alloc] init];
- [self addChildViewController:batesDeleteControl];
- [self.view addSubview:batesDeleteControl.view];
- [self.navigationController pushViewController:batesDeleteControl animated:NO];
- }];
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"Cancel Action");
- }];
- [alertController addAction:addBatesAction];
- [alertController addAction:delereBatesAction];
- [alertController addAction:cancelAction];
- [self presentViewController:alertController animated:YES completion:nil];
- }
- @end
|