Browse Source

PDFTools(iOS) - 补充隐藏form表单功能

chenyu 1 year ago
parent
commit
be5ed3da6c

BIN
compdfkit-demo.xcworkspace/xcuserdata/carry.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormButtonViewController.m

@@ -358,6 +358,11 @@
 
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
+    if(switcher.on) {
+        if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+            [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+        }
+    }
    [self.buttonWidget setHidden:switcher.on];
    [self refreshUI];
 }

+ 5 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormCheckBoxViewController.m

@@ -287,6 +287,11 @@
             [self.buttonWidget setState:0];
         }
     }else if(view == self.hideFormSwitchView) {
+        if(switcher.on) {
+            if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+                [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+            }
+        }
         [self.buttonWidget setHidden:switcher.on];
     }
     

+ 6 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormComboxViewController.m

@@ -227,6 +227,7 @@
 #pragma mark - Protect Mehtods
 
 - (void)buttonItemClicked_back:(id)sender {
+
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 
@@ -344,6 +345,11 @@
 
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
+    if(switcher.on) {
+        if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+            [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+        }
+    }
     [self.comboxChoiceWidget setHidden:switcher.on];
     [self refreshUI];
 }

+ 5 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormListViewController.m

@@ -340,6 +340,11 @@
 
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
+    if(switcher.on) {
+        if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+            [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+        }
+    }
     [self.listChoiceWidget setHidden:switcher.on];
     [self refreshUI];
 }

+ 5 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormRadioButtonViewController.m

@@ -285,6 +285,11 @@
             [self.buttonWidget setState:0];
         }
     }else if(view == self.hideFormSwitchView) {
+        if(switcher.on) {
+            if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+                [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+            }
+        }
         [self.buttonWidget setHidden:switcher.on];
     }
     

+ 6 - 0
compdfkit-tools/compdfkit-tools/Form/Controller/CPDFFormTextViewController.m

@@ -372,6 +372,12 @@
 #pragma mark  - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
     if(view == self.hideFormView) {
+        if(switcher.on) {
+            if([self.annotManage.pdfListView.activeAnnotations containsObject:self.annotManage.annotStyle.annotations.firstObject]) {
+                [self.annotManage.pdfListView updateActiveAnnotations:@[]];
+            }
+        }
+        
         [self.textWidget setHidden:switcher.on];
     }else if(view == self.multiLineView) {
         [self.textWidget setIsMultiline:switcher.on];