diff --git a/platform-darwin/Source/iOS/MPPasswordCell.m b/platform-darwin/Source/iOS/MPPasswordCell.m index 17fd3875..70187398 100644 --- a/platform-darwin/Source/iOS/MPPasswordCell.m +++ b/platform-darwin/Source/iOS/MPPasswordCell.m @@ -635,8 +635,19 @@ return NO; PearlMainQueue( ^{ - [PearlOverlay showTemporaryOverlayWithTitle:strl( @"Password Copied" ) dismissAfter:2]; - [UIPasteboard generalPasteboard].string = password; + UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; + if ([pasteboard respondsToSelector:@selector(setItems:options:)]) { + [pasteboard setItems:@[ @{ UIPasteboardTypeAutomatic: password } ] + options:@{ + UIPasteboardOptionLocalOnly : @NO, + UIPasteboardOptionExpirationDate: [NSDate dateWithTimeIntervalSinceNow:3 * 60] + }]; + [PearlOverlay showTemporaryOverlayWithTitle:strl( @"Password Copied (3 min)" ) dismissAfter:2]; + } + else { + pasteboard.string = password; + [PearlOverlay showTemporaryOverlayWithTitle:strl( @"Password Copied" ) dismissAfter:2]; + } } ); [site use];