Expire the password from the clipboard after 3 minutes on iOS 10+.
This commit is contained in:
parent
981ee171ae
commit
c8b4933c3d
@ -635,8 +635,19 @@
|
|||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
PearlMainQueue( ^{
|
PearlMainQueue( ^{
|
||||||
[PearlOverlay showTemporaryOverlayWithTitle:strl( @"Password Copied" ) dismissAfter:2];
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||||
[UIPasteboard generalPasteboard].string = password;
|
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];
|
[site use];
|
||||||
|
Loading…
Reference in New Issue
Block a user