|
@@ -477,6 +477,7 @@
|
|
|
self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y-150);
|
|
|
self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y-150);
|
|
|
} completion:nil];
|
|
|
+ self.colorSelectView.hidden = YES;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -490,6 +491,7 @@
|
|
|
self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y+150);
|
|
|
self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y+150);
|
|
|
} completion:nil];
|
|
|
+ self.colorSelectView.hidden = NO;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -590,7 +592,11 @@
|
|
|
#pragma mark - CPDFColorSelectViewDelegate
|
|
|
|
|
|
- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
|
|
|
- self.textField.textColor = color;
|
|
|
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
|
|
|
+ [attributedString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, attributedString.length)];
|
|
|
+
|
|
|
+ self.textField.attributedText = attributedString;
|
|
|
+
|
|
|
self.signatureDrawTextView.color = color;
|
|
|
[self.signatureDrawTextView setNeedsDisplay];
|
|
|
}
|
|
@@ -620,7 +626,10 @@
|
|
|
|
|
|
- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
|
|
|
self.signatureDrawTextView.color = color;
|
|
|
- self.textField.textColor = color;
|
|
|
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
|
|
|
+ [attributedString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, attributedString.length)];
|
|
|
+
|
|
|
+ self.textField.attributedText = attributedString;
|
|
|
[self.signatureDrawImageView setNeedsDisplay];
|
|
|
|
|
|
[self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
|
|
@@ -630,7 +639,10 @@
|
|
|
|
|
|
- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
|
|
|
self.signatureDrawTextView.color = viewController.selectedColor;
|
|
|
- self.textField.textColor = self.signatureDrawTextView.color;
|
|
|
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
|
|
|
+ [attributedString addAttribute:NSForegroundColorAttributeName value:self.signatureDrawTextView.color range:NSMakeRange(0, attributedString.length)];
|
|
|
+
|
|
|
+ self.textField.attributedText = attributedString;
|
|
|
[self.signatureDrawTextView setNeedsDisplay];
|
|
|
}
|
|
|
|