3 Incheckningar dab74a0192 ... 4aa829ee4d

Upphovsman SHA1 Meddelande Datum
  chenyu 4aa829ee4d Merge branch 'compdfkit_demo_ios' of git.kdan.cc:others/kmpdfkit_demo into compdfkit_demo_ios 1 år sedan
  chenyu 67b12fe900 PDFTools(iOS) - 修复页面编辑弹窗产生的bug 1 år sedan
  chenyu b778a12cdb PDFForm(iOS) - 代理优化 1 år sedan

+ 1 - 25
ComPDFKit/ComPDFKit/CPDFViewController.m

@@ -17,7 +17,7 @@
 #import <AVFAudio/AVFAudio.h>
 #import <AVFoundation/AVFoundation.h>
 
-@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFPageEditViewControllerDelegate,CPDFSignatureViewControllerDelegate>
+@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFSignatureViewControllerDelegate>
 
 @property(nonatomic, strong) CPDFAnnotationBar *annotationBar;
 
@@ -780,29 +780,5 @@
     [self.navigationController presentViewController:pageEditViewcontroller animated:YES completion:nil];
 }
 
-- (void)enterPDFPageEdit {
-    [super enterPDFPageEdit];
-    CPDFPageEditViewController *pageEditViewcontroller = [[CPDFPageEditViewController alloc] initWithPDFView:self.pdfListView];
-    pageEditViewcontroller.pageEditDelegate = self;
-    pageEditViewcontroller.modalPresentationStyle = UIModalPresentationFullScreen;
-    [self.navigationController presentViewController:pageEditViewcontroller animated:YES completion:nil];
-    [pageEditViewcontroller beginEdit];
-}
-
-#pragma mark - CPDFPageEditViewControllerDelegate
-
-- (void)pageEditViewControllerDone:(CPDFPageEditViewController *)pageEditViewController {
-    __weak typeof(self) weakSelf = self;
-    [weakSelf reloadDocumentWithFilePath:self.filePath password:nil completion:^(BOOL result) {
-        [weakSelf.pdfListView reloadInputViews];
-    }];
-
-    [weakSelf.pdfListView reloadInputViews];
-}
-
-- (void)pageEditViewController:(CPDFPageEditViewController *)pageEditViewController pageIndex:(NSInteger)pageIndex {
-    [self.pdfListView goToPageIndex:pageIndex animated:NO];
-    [self.navigationController popViewControllerAnimated:YES];
-}
 
 @end

+ 23 - 1
compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m

@@ -17,7 +17,7 @@
 #import <ComPDFKit/ComPDFKit.h>
 #import <compdfkit_tools/compdfkit_tools.h>
 
-@interface CPDFViewBaseController ()<UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate, CPDFThumbnailViewControllerDelegate,CPDFPopMenuViewDelegate,UIDocumentPickerDelegate,CPDFPopMenuDelegate,CDocumentPasswordViewControllerDelegate>
+@interface CPDFViewBaseController ()<UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate, CPDFThumbnailViewControllerDelegate,CPDFPopMenuViewDelegate,UIDocumentPickerDelegate,CPDFPopMenuDelegate,CDocumentPasswordViewControllerDelegate,CPDFPageEditViewControllerDelegate>
 
 @property(nonatomic, strong) NSString *filePath;
 
@@ -193,6 +193,28 @@
 
 - (void)enterPDFPageEdit{
     [self.popMenu hideMenu];
+    
+    CPDFPageEditViewController *pageEditViewcontroller = [[CPDFPageEditViewController alloc] initWithPDFView:self.pdfListView];
+    pageEditViewcontroller.pageEditDelegate = self;
+    pageEditViewcontroller.modalPresentationStyle = UIModalPresentationFullScreen;
+    [self.navigationController presentViewController:pageEditViewcontroller animated:YES completion:nil];
+    [pageEditViewcontroller beginEdit];
+}
+
+#pragma mark - CPDFPageEditViewControllerDelegate
+
+- (void)pageEditViewControllerDone:(CPDFPageEditViewController *)pageEditViewController {
+    __weak typeof(self) weakSelf = self;
+    [weakSelf reloadDocumentWithFilePath:self.filePath password:nil completion:^(BOOL result) {
+        [weakSelf.pdfListView reloadInputViews];
+    }];
+
+    [weakSelf.pdfListView reloadInputViews];
+}
+
+- (void)pageEditViewController:(CPDFPageEditViewController *)pageEditViewController pageIndex:(NSInteger)pageIndex {
+    [self.pdfListView goToPageIndex:pageIndex animated:NO];
+    [self.navigationController popViewControllerAnimated:YES];
 }
 
 #pragma mark - Public method

+ 0 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenuView.m

@@ -35,7 +35,6 @@
 }
 
 - (void)setUp {
-    
     self.menuItemTitleArr = [@[NSLocalizedString(@"View Settings", nil), NSLocalizedString(@"Document Info", nil), NSLocalizedString(@"Share", nil), NSLocalizedString(@"Open...", nil), NSLocalizedString(@"Page Edit", nil)] mutableCopy];
     self.menuItemIconArr = [@[@"CNavigationImageNamePreview", @"CNavigationImageNameInformation", @"CNavigationImageNameShare", @"CNavigationImageNameNewFile", @"CNavigationImageNamePageEditTool"] mutableCopy];
     

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Form.m

@@ -455,7 +455,7 @@
     return dateString;
 }
 
-- (void)showMenuForWidgetAnnotation:(CPDFWidgetAnnotation *)annotation {
+- (void)showMenuForWidgetAnnotation:(CPDFWidgetAnnotation *)annotation { 
     if (!annotation) {
         [UIMenuController sharedMenuController].menuItems = nil;
         if (@available(iOS 13.0, *)) {