Fixing copied/saved toasts on ios.

This commit is contained in:
Samuel Clay 2018-07-13 15:25:27 -04:00
parent b93831609f
commit cf70d7b65f
3 changed files with 6 additions and 5 deletions

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="ipad9_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">

View file

@ -2029,8 +2029,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
if (copy) {
[UIPasteboard generalPasteboard].image = image;
[self flashCheckmarkHud:@"copied"];
}
if (save) {
} else if (save) {
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
changeRequest.creationDate = [NSDate date];
@ -2131,6 +2130,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
- (void)flashCheckmarkHud:(NSString *)messageType {
[MBProgressHUD hideHUDForView:self.webView animated:NO];
[MBProgressHUD hideHUDForView:appDelegate.storyPageControl.currentPage.view animated:NO];
self.storyHUD = [MBProgressHUD showHUDAddedTo:self.webView animated:YES];
self.storyHUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]];
self.storyHUD.mode = MBProgressHUDModeCustomView;

View file

@ -1247,10 +1247,11 @@
#pragma mark HUDs
- (void)showShareHUD:(NSString *)msg {
// [MBProgressHUD hideHUDForView:self.view animated:NO];
[MBProgressHUD hideHUDForView:self.view animated:NO];
self.storyHUD = [MBProgressHUD showHUDAddedTo:currentPage.view animated:YES];
self.storyHUD.labelText = msg;
self.storyHUD.margin = 20.0f;
self.storyHUD.removeFromSuperViewOnHide = YES;
self.currentPage.noStoryMessage.hidden = YES;
}