From 51166e5f0ad9aad3f7cb5525d970eda045b60c68 Mon Sep 17 00:00:00 2001 From: schystz Date: Tue, 18 Mar 2014 22:32:54 +0800 Subject: [PATCH] Bugfix: Tapping of TSMessageView doesn't dismiss it Cause: Two tap gesture recognzier is added to the view which cancels the previous one --- TSMessages/Views/TSMessageView.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TSMessages/Views/TSMessageView.m b/TSMessages/Views/TSMessageView.m index ef6039c2..365c30c2 100755 --- a/TSMessages/Views/TSMessageView.m +++ b/TSMessages/Views/TSMessageView.m @@ -327,9 +327,11 @@ - (id)initWithTitle:(NSString *)title [self addGestureRecognizer:tapRec]; } - UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; - tapGesture.delegate = self; - [self addGestureRecognizer:tapGesture]; + if (self.callback) { + UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; + tapGesture.delegate = self; + [self addGestureRecognizer:tapGesture]; + } } return self; }