forked from mirrors/linphone-iphone
Fix chat bubble to have both clickable hypertext links AND popup menu for reply/transfer actions
This commit is contained in:
parent
a6fb4e42b7
commit
9d2589535b
4 changed files with 20 additions and 18 deletions
|
|
@ -66,10 +66,7 @@
|
|||
self.vrView.layer.cornerRadius = 30.0f;
|
||||
self.vrView.layer.masksToBounds = YES;
|
||||
[self.innerView addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onPopupMenuPressed)]];
|
||||
self.messageText.userInteractionEnabled = true;
|
||||
self.messageText.editable = false;
|
||||
self.messageText.selectable = true;
|
||||
self.messageText.dataDetectorTypes = UIDataDetectorTypeLink;
|
||||
[self.messageText addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onPopupMenuPressed)]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,10 +47,7 @@
|
|||
|
||||
|
||||
[_innerView addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onPopupMenuPressed)]];
|
||||
_messageText.userInteractionEnabled = true;
|
||||
_messageText.editable = false;
|
||||
_messageText.selectable = true;
|
||||
_messageText.dataDetectorTypes = UIDataDetectorTypeLink;
|
||||
[_messageText addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onPopupMenuPressed)]];
|
||||
|
||||
|
||||
self.contentView.userInteractionEnabled = NO;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UITextViewNoDefine : UITextView
|
||||
@interface UITextViewNoDefine : UITextView<UITextViewDelegate>
|
||||
|
||||
@property BOOL allowSelectAll;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,15 +23,23 @@
|
|||
|
||||
@synthesize allowSelectAll;
|
||||
|
||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
|
||||
// disable "define" option, since it messes with the keyboard
|
||||
if ([[NSStringFromSelector(action) lowercaseString] rangeOfString:@"define"].location != NSNotFound) {
|
||||
return NO;
|
||||
} else if (action == @selector(selectAll:) && allowSelectAll) {
|
||||
return YES;
|
||||
} else {
|
||||
return [super canPerformAction:action withSender:sender];
|
||||
}
|
||||
-(void)awakeFromNib{
|
||||
[super awakeFromNib];
|
||||
self.delegate = self;
|
||||
self.userInteractionEnabled = true;
|
||||
self.editable = false;
|
||||
self.selectable = true;
|
||||
self.dataDetectorTypes = UIDataDetectorTypeLink;
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeFirstResponder {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)textViewDidChangeSelection:(UITextView *)textView
|
||||
{
|
||||
textView.selectedTextRange = nil;
|
||||
[textView endEditing:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue