Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #609 from matrix-org/riot_2738
Browse files Browse the repository at this point in the history
MXKRoomBubbleTableViewCell: Fix issue with links too easily touchable on iOS 13
  • Loading branch information
SBiOSoftWhare authored Oct 4, 2019
2 parents c40f4a3 + 4a4781d commit 8a0ca8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Improvements:

Bug fix:
* Display correctly the revoked third-party invite.
* MXKRoomBubbleTableViewCell: Fix issue with links too easily touchable on iOS 13 (vector-im/riot-ios/issues/2738).

Changes in MatrixKit in 0.10.2 (2019-08-08)
==========================================
Expand Down
9 changes: 8 additions & 1 deletion MatrixKit/Views/RoomBubbleList/MXKRoomBubbleTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -1471,9 +1471,16 @@ - (IBAction)onLongPressGesture:(UILongPressGestureRecognizer*)longPressGestureRe

#pragma mark - UITextView delegate

// Hyperlink quick tap in `messageTextView` are intercepted by `-(void)onMessageTap:` method. Otherwise longer tap, long press and force touch on a link are still catched here.
// On iOS 10 to iOS 13.0: Hyperlink quick tap in `messageTextView` are intercepted by `-(void)onMessageTap:` method. Otherwise longer tap, long press and force touch on a link are still catched here.
// On iOS 13.1+: The inner tap gesture of `messageTextView` is called before the tap gesture manually added by `MXKRoomBubbleTableViewCell`. Hyperlink quick tap and long press are intercepted here.
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction API_AVAILABLE(ios(10.0))
{
// Do not interact with hyperlink on quick tap (default action). Let `-(void)onMessageTap:` method handle hyperlink quick tap.
if (interaction == UITextItemInteractionInvokeDefaultAction)
{
return NO;
}

BOOL shouldInteractWithURL = YES;

if (delegate && URL)
Expand Down

0 comments on commit 8a0ca8e

Please sign in to comment.