|
|
@@ -265,8 +265,30 @@ static BOOL my_os_log_shim_enabled(void *addr) {
|
|
|
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
|
|
|
if (action == @selector(copy:)) {
|
|
|
// We usually only want to copy the log message itself, not any metadata associated with it.
|
|
|
- UIPasteboard.generalPasteboard.string = self.logMessages.filteredList[indexPath.row].messageText;
|
|
|
+ UIPasteboard.generalPasteboard.string = self.logMessages.filteredList[indexPath.row].messageText ?: @"";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#if FLEX_AT_LEAST_IOS13_SDK
|
|
|
+
|
|
|
+- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView
|
|
|
+contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
+ point:(CGPoint)point __IOS_AVAILABLE(13.0) {
|
|
|
+ __weak __typeof__(self) weakSelf = self;
|
|
|
+ return [UIContextMenuConfiguration configurationWithIdentifier:nil
|
|
|
+ previewProvider:nil
|
|
|
+ actionProvider:^UIMenu *(NSArray<UIMenuElement *> *suggestedActions) {
|
|
|
+ UIAction *copy = [UIAction actionWithTitle:@"Copy"
|
|
|
+ image:nil
|
|
|
+ identifier:@"Copy"
|
|
|
+ handler:^(__kindof UIAction *action) {
|
|
|
+ // We usually only want to copy the log message itself, not any metadata associated with it.
|
|
|
+ UIPasteboard.generalPasteboard.string = weakSelf.logMessages.filteredList[indexPath.row].messageText ?: @"";
|
|
|
+ }];
|
|
|
+ return [UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[copy]];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
@end
|