diff --git a/class/HPGrowingTextView.h b/class/HPGrowingTextView.h index 8b343c5..34134c4 100644 --- a/class/HPGrowingTextView.h +++ b/class/HPGrowingTextView.h @@ -103,6 +103,9 @@ @property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); @property (nonatomic) UIReturnKeyType returnKeyType; @property (nonatomic) UIKeyboardType keyboardType; +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +@property (nonatomic) UIKeyboardAppearance keyboardAppearance; +#endif @property (assign) UIEdgeInsets contentInset; @property (nonatomic) BOOL isScrollable; @property(nonatomic) BOOL enablesReturnKeyAutomatically; diff --git a/class/HPGrowingTextView.m b/class/HPGrowingTextView.m index 9871c6f..31020af 100644 --- a/class/HPGrowingTextView.m +++ b/class/HPGrowingTextView.m @@ -548,6 +548,21 @@ - (UIKeyboardType)keyboardType return internalTextView.keyboardType; } +/////////////////////////////////////////////////////////////////////////////////////////////////// +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 + +- (void)setKeyboardAppearance:(UIKeyboardAppearance)keyAppearance +{ + if ([internalTextView respondsToSelector:@selector(setKeyboardAppearance:)]) { + internalTextView.keyboardAppearance = keyAppearance; + } +} + +- (UIKeyboardAppearance)keyboardAppearance +{ + return internalTextView.keyboardAppearance; +} +#endif /////////////////////////////////////////////////////////////////////////////////////////////////// - (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically diff --git a/class/HPTextViewInternal.m b/class/HPTextViewInternal.m index f3a6a1d..f8fc0ad 100644 --- a/class/HPTextViewInternal.m +++ b/class/HPTextViewInternal.m @@ -111,7 +111,11 @@ - (void)drawRect:(CGRect)rect } else { [self.placeholderColor set]; +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; +#else + [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withAttributes:[[NSDictionary alloc] initWithObjectsAndKeys:self.font, NSFontAttributeName,nil]]; +#endif } } }