diff --git a/SAMTextView/SAMTextView.m b/SAMTextView/SAMTextView.m index 7c7801c..56f2672 100644 --- a/SAMTextView/SAMTextView.m +++ b/SAMTextView/SAMTextView.m @@ -41,7 +41,9 @@ - (void)setPlaceholder:(NSString *)string { if ([self isFirstResponder] && self.typingAttributes) { [attributes addEntriesFromDictionary:self.typingAttributes]; } else { - attributes[NSFontAttributeName] = self.font; + if (self.font) { + attributes[NSFontAttributeName] = self.font; + } attributes[NSForegroundColorAttributeName] = [UIColor colorWithWhite:0.702f alpha:1.0f]; if (self.textAlignment != NSTextAlignmentLeft) { @@ -139,7 +141,7 @@ - (CGRect)placeholderRectForBounds:(CGRect)bounds { if (self.contentInset.left == 0.0f) { rect.origin.x += 8.0f; } - rect.origin.y += 8.0f; + rect.origin.y += self.contentInset.top; } return rect;