Skip to content

Commit 51166e5

Browse files
author
schystz
committed
Bugfix: Tapping of TSMessageView doesn't dismiss it
Cause: Two tap gesture recognzier is added to the view which cancels the previous one
1 parent b9d9ee3 commit 51166e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

TSMessages/Views/TSMessageView.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,11 @@ - (id)initWithTitle:(NSString *)title
327327
[self addGestureRecognizer:tapRec];
328328
}
329329

330-
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
331-
tapGesture.delegate = self;
332-
[self addGestureRecognizer:tapGesture];
330+
if (self.callback) {
331+
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
332+
tapGesture.delegate = self;
333+
[self addGestureRecognizer:tapGesture];
334+
}
333335
}
334336
return self;
335337
}

0 commit comments

Comments
 (0)