123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // BatesSettingViewController.m
- // PDFViewer
- //
- // Created by kdanmobile_2 on 2022/11/17.
- //
- #import "CPDFBatesSettingController.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) {
- self.batesAddControl = [[CPDFBatesAddViewController alloc] initWithIamge:self.image WithSize:self.size];
- [self addChildViewController:self.batesAddControl];
- [self.view addSubview:self.batesAddControl.view];
- [self.navigationController pushViewController:self.batesAddControl animated:NO];
- self.view.hidden = YES;
- }];
- 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
|