Experimental Feature: Game Screenshots#242
Conversation
- isAuthorized to check/ask for authorization - saveUIImage to save a UIImage to Photos
rileytestut
left a comment
There was a problem hiding this comment.
Thanks for breaking these PRs up! Overall looks good to me, just have one note about the implementation of isAuthorized that could result in minor bug, but once that’s fixed I’d be happy to merge 🙂
Also I appreciate you putting the PHPhotoLibrary stuff in an extension! The more isolated changes are from the rest of the app, the better 👍
- Ensures that the screenshot is saved when the user is first prompted for access to Photos - More elegant extension code
There was a problem hiding this comment.
Nice approach, passing in a closure that's only run if authorized is a good idea.
Thanks for these changes, everything looks good to me! Will merge this in along with #241 once everything is merged into develop branch 👍
| @unknown default: | ||
| return false | ||
| } | ||
| PHPhotoLibrary.requestAuthorization(for: .addOnly, handler: { success in |
There was a problem hiding this comment.
Nice, forgot about the .addOnly option! Good call.
| return false | ||
| } | ||
| PHPhotoLibrary.requestAuthorization(for: .addOnly, handler: { success in | ||
| switch success |
There was a problem hiding this comment.
Minor nit, but I think result might be a better name than success since it's an enum not a Bool. But I'll still merge anyway since doesn't really matter, just for future notice.
* Adds extension to handle interactions with Photos app - isAuthorized to check/ask for authorization - saveUIImage to save a UIImage to Photos * Adds a Pause Menu button for taking game screenshots * Adds @feature and @options for Game Screenshots * Implements Game Screenshots feature in GameViewController * Updates project settings * Passes call to save to Photos as a closure into authorization prompt - Ensures that the screenshot is saved when the user is first prompted for access to Photos - More elegant extension code --------- Co-authored-by: Riley Testut <riley@rileytestut.com>
No description provided.