-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
The following code is obsolete regarding three commended lines:
- (void)handleTextViewDidChangeNotification:(NSNotification *)notification
{
if (notification.object == self)
{
CGRect line = [self caretRectForPosition: self.selectedTextRange.start];
CGFloat overflow = line.origin.y + line.size.height - ( self.contentOffset.y + self.bounds.size.height - self.contentInset.bottom - self.contentInset.top );
if ( overflow > 0 )
{
// We are at the bottom of the visible text and introduced a line feed, scroll down (iOS 7 does not do it)
// Scroll caret to visible area
CGPoint offset = self.contentOffset;
offset.y += overflow + 7; // leave 7 pixels margin
// Cannot animate with setContentOffset:animated: or caret will not appear
// [UIView animateWithDuration:.2 animations:^{
// [self setContentOffset:offset];
// }];
}
}
}
Metadata
Metadata
Assignees
Labels
No labels