mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 23:26:37 +00:00
Improved PR following reviewer recommendations
This commit is contained in:
parent
fd88496dcb
commit
49899ccb2c
2 changed files with 11 additions and 11 deletions
|
@ -1545,7 +1545,7 @@
|
|||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
||||
INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to attach to your Mastodon posts.";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2024 Thomas Ricouard";
|
||||
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "";
|
||||
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Ice Cubes would like to save the selected photo in your photo library.";
|
||||
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon";
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
|
@ -1612,7 +1612,7 @@
|
|||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
||||
INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to attach to your Mastodon posts.";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2024 Thomas Ricouard";
|
||||
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "";
|
||||
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Ice Cubes would like to save the selected photo in your photo library.";
|
||||
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon";
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
|
|
|
@ -185,17 +185,17 @@ private struct SavePhotoToolbarItem: ToolbarContent, @unchecked Sendable {
|
|||
}
|
||||
|
||||
private func saveImage(url: URL) async -> Bool {
|
||||
guard let image = try? await uiimageFor(url: url) else { return false }
|
||||
|
||||
var status = PHPhotoLibrary.authorizationStatus(for: .addOnly)
|
||||
|
||||
if let image = try? await uiimageFor(url: url) {
|
||||
if status != .authorized {
|
||||
await PHPhotoLibrary.requestAuthorization(for: .addOnly)
|
||||
status = PHPhotoLibrary.authorizationStatus(for: .addOnly)
|
||||
}
|
||||
if status == .authorized {
|
||||
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
|
||||
return true
|
||||
}
|
||||
if status != .authorized {
|
||||
await PHPhotoLibrary.requestAuthorization(for: .addOnly)
|
||||
status = PHPhotoLibrary.authorizationStatus(for: .addOnly)
|
||||
}
|
||||
if status == .authorized {
|
||||
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue