-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add (Apple Intelligence) image playground to the Quick Editor #565
Conversation
📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
|
@@ -498,6 +501,7 @@ | |||
ENABLE_USER_SCRIPT_SANDBOXING = NO; | |||
GENERATE_INFOPLIST_FILE = YES; | |||
INFOPLIST_FILE = "Demo/Gravatar-Demo/Info.plist"; | |||
INFOPLIST_KEY_NSCameraUsageDescription = "Accessing camera to create an avatar."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess NSCameraUsageDescription
was removed during the merge of two demo apps. So I am adding it back.
|
||
var id: Int { | ||
self.hashValue | ||
} | ||
} | ||
|
||
@State var isPresented = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used from anywhere so I am removing it.
isPresented: Binding( | ||
get: { sourceType == .playground }, | ||
set: { if !$0 { sourceType = nil } } | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this to be able to add the new case playground
to SourceType
and still have these be managed by a single sourceType
variable.
(The system offers a modifier for the playground not a View. But our existing image sources are Views. So they are displayed with different methods.)
static var allCases: [SourceType] { | ||
var cases: [SourceType] = [.camera, .photoLibrary] | ||
if #available(iOS 18.2, *) { | ||
if EnvironmentValues().supportsImagePlayground { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works flawlessly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked great! A few notes:
Images generated in this Playground sheet are available in my Playground app. That's a nice and unexpected feature of the service.
I had something unexpected happen. It's probably an issue with the beta. but I'll mention it anyway:
- Performed testing steps, as instructed
- After disabling Apple Intelligence, and testing in that state, I re-enabled Apple Intelligence
- I put the phone down and started looking at the PR diff
- When I wasn't looking, the phone restarted (crash?)... I had to re-enter my pin in order to unlock the iphone
- I went back to the Demo app, and immediately tried to use the playground again.
- When the Playground sheet opened, I saw the message below
- I launched the Playground app to see if it gave the same message, but was fully functional
- Returned to the Demo app, and the Playground worked
Did I just have remarkable timing, and the image playground models finished downloading in the second it took me to launch the Playground app?
The crash is very suspicious, of course. So I'm attributing this to "beta".
Yeah that sounds like a system issue... |
Closes #568 (comment)
Description
Adds the image playground of Apple to the QuickEditor.
ScreenRecording_11-20-2024.11-41-45_1.MP4
Testing Steps
Upgrade to iOS 18.2 beta
Turn on Apple Intelligence
Go to the demo app > Quick Editor flow
Choose "Playground"
Test other image sources as well
Turn off Apple Intelligence via device settings