2 次代码提交 437f167743 ... 1086ff678f

作者 SHA1 备注 提交日期
  chenyu 1086ff678f Merge branch 'compdfkit_demo_ios' of git.kdan.cc:others/kmpdfkit_demo into compdfkit_demo_ios 1 年之前
  chenyu d76758de4c PDFTools(iOS) - Fixed 17874【form】添加签名form,进入viewer-签名设置-文本签名,未输入文字前提下还能点save保存(应该是不能才对) 1 年之前

+ 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];