1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // HeaderFooterSettingViewController.m
- // PDFViewer
- //
- // Created by kdanmobile_2 on 2022/11/21.
- //
- #import "CPDFHeaderFooterSettingController.h"
- @interface CPDFHeaderFooterSettingController ()
- @end
- @implementation CPDFHeaderFooterSettingController
- - (id)initWithIamge:(UIImage *)image WithSize:(CGSize)size WithDocument:(CPDFDocument *)docment WithView:(CPDFView *)pdfView {
- self = [super init];
- if (self) {
- _image = image;
- _size = size;
- _document = docment;
- _pdfView = pdfView;
- }
- return self;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
- //add headerfooter action
- UIAlertAction *addHeaderfooterAction = [UIAlertAction actionWithTitle:@"Add Headerfooter" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- self.headerFooterControl = [[CPDFHeaderFooterAddController alloc] initWithIamge:self.image WithSize:self.size WithDocument:self.document WithView:self.pdfView];
- [self addChildViewController:self.headerFooterControl];
- [self.view addSubview:self.headerFooterControl.view];
- [self.navigationController pushViewController:self.headerFooterControl animated:NO];
- self.view.hidden = YES;
- }];
- //delete headerfooter action
- UIAlertAction *deleteHeaderfooterAction = [UIAlertAction actionWithTitle:@"Delete Headerfooter" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- CPDFHeaderFooterDeleteController *headerFooterDeleteControl = [[CPDFHeaderFooterDeleteController alloc] init];
- [self addChildViewController:headerFooterDeleteControl];
- [self.view addSubview:headerFooterDeleteControl.view];
- }];
- //cancel Action
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
- NSLog(@"Cancel Action");
- self.view.hidden = YES;
- }];
- [alertController addAction:addHeaderfooterAction];
- [alertController addAction:deleteHeaderfooterAction];
- [alertController addAction:cancelAction];
- [self presentViewController:alertController animated:YES completion:nil];
- }
- @end
|