From 9bb5189677306c651ce7f56f153ad2f66963c60b Mon Sep 17 00:00:00 2001 From: Wasupol Tungsakultong Date: Thu, 21 Apr 2016 02:07:56 +0700 Subject: [PATCH] remove deprecate --- class/HPTextViewInternal.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/class/HPTextViewInternal.m b/class/HPTextViewInternal.m index f3a6a1d..c014671 100644 --- a/class/HPTextViewInternal.m +++ b/class/HPTextViewInternal.m @@ -111,7 +111,14 @@ - (void)drawRect:(CGRect)rect } else { [self.placeholderColor set]; - [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; + if ([self.placeholder respondsToSelector:@selector(drawInRect:withAttributes:)]) { + [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withAttributes:@{NSFontAttributeName : self.font}]; + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; +#pragma clang diagnostic pop + } } } }