0

[iOS] Share extension - Text sharing UI

This CL adds the text sharing UI for the new share extension.

Bug: 396326825
Change-Id: Id019c7d90e4dc6adfed437928634d5827416f01d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6343098
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Commit-Queue: Elmehdi Rahmaoui <erahmaoui@google.com>
Cr-Commit-Position: refs/heads/main@{#1431760}
This commit is contained in:
Elmehdi Rahmaoui
2025-03-12 14:34:50 -07:00
committed by Chromium LUCI CQ
parent e33f048404
commit 1c44ce70bc
2 changed files with 13 additions and 3 deletions

@@ -279,7 +279,14 @@ const CGFloat kShareSheetCornerRadius = 20;
- (void)handleText:(id)idText - (void)handleText:(id)idText
forItem:(NSExtensionItem*)item forItem:(NSExtensionItem*)item
withError:(NSError*)error { withError:(NSError*)error {
// TODO(crbug.com/396326361): Handle shared text. self.shareText = [[item attributedContentText] string];
self.shareItem = item;
if (self.shareText) {
[self displayShareSheet];
} else {
[self displayErrorView];
}
} }
- (void)loadElementsFromContext { - (void)loadElementsFromContext {

@@ -270,8 +270,11 @@ NSString* const kCustomMinimizedDetentIdentifier = @"customMinimizedDetent";
} }
- (UIView*)configureSharedTextView { - (UIView*)configureSharedTextView {
// TODO(crbug.com/396326361): Add text sharing ui configuration. UILabel* sharedTextLabel = [[UILabel alloc] init];
return nil; sharedTextLabel.text = self.sharedText;
sharedTextLabel.numberOfLines = 0;
return sharedTextLabel;
} }
- (UIImageView*)configureSnapshotView { - (UIImageView*)configureSnapshotView {