Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mobile): long-press file references for path and open actions #9258

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/9258/headmerged by juliusmarminge View on GitHub

Showing 17 changed files with 165 additions and 11 deletions (loading 14).

x
0 of 17 viewed, 17 left
92 additions and 9 deletionsapps/mobile/modules/t3-markdown-text/ios/T3MarkdownText.mmModified4 lines can hide code
View file
@@ -198,6 +198,8 @@
BOOL _suppressSelectionChange;
NSMutableDictionary<NSString *, UIImage *> * _attachmentImages;
NSMutableSet<NSString *> * _pendingAttachmentUris;
+ UILongPressGestureRecognizer *_longPressGestureRecognizer;
+ UITapGestureRecognizer *_pressGestureRecognizer;
​
+ (ComponentDescriptorProvider)componentDescriptorProvider
@@ -223,21 +225,24 @@
_textView.textContainerInset = UIEdgeInsetsZero;
_textView.textContainer.lineFragmentPadding = 0;
_textView.delegate = self;
+ // Chat text supports selection and contextual actions, but not drag-and-drop.
+ _textView.textDragInteraction.enabled = NO;
+ _textView.linkTextAttributes = @{};
// Must match RCTTextLayoutManager, which measures with usesFontLeading = NO.
_textView.layoutManager.usesFontLeading = NO;
[self addSubview:_textView];
​
- const auto longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self
Code far to the right: this line has a long run of spaces or tabs before more code. Scroll right to read it.231
- action:@selector(handleLongPressIfNecessary:)];
- longPressGestureRecognizer.delegate = self;
+ _longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self
Code far to the right: this line has a long run of spaces or tabs before more code. Scroll right to read it.236
+ action:@selector(handleLongPressIfNecessary:)];
+ _longPressGestureRecognizer.delegate = self;
​
- const auto pressGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
Code far to the right: this line has a long run of spaces or tabs before more code. Scroll right to read it.235
- action:@selector(handlePressIfNecessary:)];