Skip to content

Commit 3c1ce9c

Browse files
committed
attempt to fix iOS 7 data detector parsing bug with strong ref to text view.
1 parent 5b014c7 commit 3c1ce9c

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

JSMessagesViewController/Classes/JSBubbleView.m

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,21 @@ - (instancetype)initWithFrame:(CGRect)frame
6161
[self addSubview:bubbleImageView];
6262
_bubbleImageView = bubbleImageView;
6363

64-
UITextView *textView = [[UITextView alloc] init];
65-
textView.font = [UIFont systemFontOfSize:16.0f];
66-
textView.textColor = [UIColor blackColor];
67-
textView.editable = NO;
68-
textView.userInteractionEnabled = YES;
69-
textView.showsHorizontalScrollIndicator = NO;
70-
textView.showsVerticalScrollIndicator = NO;
71-
textView.scrollEnabled = NO;
72-
textView.backgroundColor = [UIColor clearColor];
73-
textView.contentInset = UIEdgeInsetsZero;
74-
textView.scrollIndicatorInsets = UIEdgeInsetsZero;
75-
textView.contentOffset = CGPointZero;
76-
textView.dataDetectorTypes = UIDataDetectorTypeAll;
77-
[self addSubview:textView];
78-
[self bringSubviewToFront:textView];
79-
_textView = textView;
64+
_textView = [[UITextView alloc] init];
65+
_textView.font = [UIFont systemFontOfSize:16.0f];
66+
_textView.textColor = [UIColor blackColor];
67+
_textView.editable = NO;
68+
_textView.userInteractionEnabled = YES;
69+
_textView.showsHorizontalScrollIndicator = NO;
70+
_textView.showsVerticalScrollIndicator = NO;
71+
_textView.scrollEnabled = NO;
72+
_textView.backgroundColor = [UIColor clearColor];
73+
_textView.contentInset = UIEdgeInsetsZero;
74+
_textView.scrollIndicatorInsets = UIEdgeInsetsZero;
75+
_textView.contentOffset = CGPointZero;
76+
_textView.dataDetectorTypes = UIDataDetectorTypeAll;
77+
[self addSubview:_textView];
78+
[self bringSubviewToFront:_textView];
8079

8180
// NOTE: TODO: textView frame & text inset
8281
// --------------------

0 commit comments

Comments
 (0)