Skip to content

Commit 8bcfa7b

Browse files
committed
fix: share sheet not woring on ios 15
Signed-off-by: Lessica <82flex@gmail.com>
1 parent 6771e40 commit 8bcfa7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

TrollFools/StripedTextTableViewController.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ - (void)viewDidLoad {
7575

7676
NSMutableArray <UIBarButtonItem *> *rightBarButtonItems = [NSMutableArray arrayWithCapacity:2];
7777

78-
if (self.allowShare) {
79-
[rightBarButtonItems addObject:self.shareItem];
78+
if (@available(iOS 16.0, *)) {
79+
if (self.allowShare) {
80+
[rightBarButtonItems addObject:self.shareItem];
81+
}
8082
}
8183

8284
if (self.allowTrash) {
@@ -258,6 +260,7 @@ - (void)shareItemTapped:(UIBarButtonItem *)sender {
258260
} else {
259261
// Fallback on earlier versions
260262
activityViewController.popoverPresentationController.barButtonItem = sender;
263+
activityViewController.popoverPresentationController.sourceView = self.view;
261264
}
262265
[self presentViewController:activityViewController animated:YES completion:nil];
263266
}

0 commit comments

Comments
 (0)