Explorar o código

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

chenyu hai 1 ano
pai
achega
be5ed3da6c

BIN=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
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
 - (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.buttonWidget setHidden:switcher.on];
    [self refreshUI];
    [self refreshUI];
 }
 }

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

@@ -287,6 +287,11 @@
             [self.buttonWidget setState:0];
             [self.buttonWidget setState:0];
         }
         }
     }else if(view == self.hideFormSwitchView) {
     }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];
         [self.buttonWidget setHidden:switcher.on];
     }
     }
     
     

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

@@ -227,6 +227,7 @@
 #pragma mark - Protect Mehtods
 #pragma mark - Protect Mehtods
 
 
 - (void)buttonItemClicked_back:(id)sender {
 - (void)buttonItemClicked_back:(id)sender {
+
     [self dismissViewControllerAnimated:YES completion:nil];
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 }
 
 
@@ -344,6 +345,11 @@
 
 
 #pragma mark - CPDFFormSwitchViewDelegate
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
 - (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.comboxChoiceWidget setHidden:switcher.on];
     [self refreshUI];
     [self refreshUI];
 }
 }

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

@@ -340,6 +340,11 @@
 
 
 #pragma mark - CPDFFormSwitchViewDelegate
 #pragma mark - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
 - (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.listChoiceWidget setHidden:switcher.on];
     [self refreshUI];
     [self refreshUI];
 }
 }

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

@@ -285,6 +285,11 @@
             [self.buttonWidget setState:0];
             [self.buttonWidget setState:0];
         }
         }
     }else if(view == self.hideFormSwitchView) {
     }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];
         [self.buttonWidget setHidden:switcher.on];
     }
     }
     
     

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

@@ -372,6 +372,12 @@
 #pragma mark  - CPDFFormSwitchViewDelegate
 #pragma mark  - CPDFFormSwitchViewDelegate
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
 - (void)SwitchActionInView:(CPDFFormSwitchView *)view switcher:(UISwitch *)switcher {
     if(view == self.hideFormView) {
     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];
         [self.textWidget setHidden:switcher.on];
     }else if(view == self.multiLineView) {
     }else if(view == self.multiLineView) {
         [self.textWidget setIsMultiline:switcher.on];
         [self.textWidget setIsMultiline:switcher.on];