Skip to content
This repository was archived by the owner on Apr 22, 2019. It is now read-only.

Fix and feature support for iOS7 #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions class/HPGrowingTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions class/HPGrowingTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions class/HPTextViewInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down