Skip to content

Commit 030c4dc

Browse files
committed
Fix that placeholderTextColor doesn't exist in iOS SDK < 13
1 parent e1c7dae commit 030c4dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/UITextView+Placeholder.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ - (void)swizzledDealloc {
5555

5656
+ (UIColor *)defaultPlaceholderColor {
5757
if (@available(iOS 13, *)) {
58-
return [UIColor placeholderTextColor];
58+
SEL selector = NSSelectorFromString(@"placeholderTextColor");
59+
if ([UIColor respondsToSelector:selector]) {
60+
return [UIColor performSelector:selector];
61+
}
5962
}
6063
static UIColor *color = nil;
6164
static dispatch_once_t onceToken;

0 commit comments

Comments
 (0)