Browse Source

PDFTools(iOS) - Fixed 17874【form】添加签名form,进入viewer-签名设置-文本签名,未输入文字前提下还能点save保存(应该是不能才对)

chenyu 1 year ago
parent
commit
d76758de4c

+ 7 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -300,6 +300,13 @@
         }
     }else if (CSignatureTopBarText == self.selecIndex) {
         UIImage *image = [self captureScreenshotOfTextField:self.textField];
+        if(self.textField.text.length == 0) {
+            UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Info" message:@"Please input Signature" preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil];
+            [alertController addAction:cancelAction];
+            [self presentViewController:alertController animated:YES completion:nil];
+            return;
+        }
         if (self.textField.text) {
             if(self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
                 [self.delegate signatureEditViewController:self image:image];