Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #96 from lohilabs/removeSelfFrameAdjustment
Browse files Browse the repository at this point in the history
Removed the frame setting in 'updateText'.
  • Loading branch information
Sebastien C. Thiebaud committed Apr 14, 2014
2 parents 42a3e0e + 5dda287 commit 3c38bfd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions STTweetLabel/STTweetLabel.m
Expand Up @@ -225,8 +225,6 @@ - (void)updateText
_textView.textContainer.lineFragmentPadding = 0;
_textView.textContainerInset = UIEdgeInsetsZero;
_textView.userInteractionEnabled = NO;
[_textView sizeToFit];
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, _textView.frame.size.height);
[self addSubview:_textView];
}

Expand All @@ -237,7 +235,7 @@ - (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width
if (_cleanText == nil)
return CGSizeZero;

return [_textStorage.attributedString boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil].size;
return [_textView sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)];
}

#pragma mark -
Expand Down

0 comments on commit 3c38bfd

Please sign in to comment.