JanGorman / Agrume

🍋 A lemony fresh iOS image viewer written in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Live Text interactions that present system controller (like Add Sticker or Share) fail

nemecek-filip opened this issue · comments

Hello,

I am not sure if this is something that Agrume can fix or if it is an issue on Apple's side. I wanted to try creating stickers in my app by enabling the Live Text integration in my Agrume integration.

However when I select subject and pick either "Add Sticker" or "Share" in the popup menu, nothing happens and Xcode shows this error:

Attempt to present <_UIStickerPickerViewController: 0x105c21150> on <GameWidgets.MainTabBarViewController: 0x10480f200> (from <GameWidgets.MainTabBarViewController: 0x10480f200>) which is already presenting <Agrume.Agrume: 0x106048600>.

Maybe it needs this implementation? https://developer.apple.com/documentation/visionkit/imageanalysisinteractiondelegate/3974501-presentingviewcontroller

But I am not sure, haven't been able to google anything similar.

Happy to try to fix this with a PR.

Just to be clear, this is the "popup menu" I am referring to:

Screenshot 2023-10-31 at 21 09 48

Hey, thanks for opening the issue. I think I understand the error message – to be sure, could you share the code that you're currently using to present the sticker controller and how it interacts with Agrume. Thanks!

Sorry, I probably haven't made it obvious. The UIStickerPickerViewController is some private system one and is managed by the Live Text interaction. Same goes for the popup menu from the screenshots, that is also done automatically.

It seems the system picks the root view controller from window and tries to present the sticker picker or share sheet (UIActivityViewController) from that

@nemecek-filip Thanks for the insight. Not super familiar with that API. Could you try on this branch https://github.com/JanGorman/Agrume/tree/image-analysis-interaction and if that fixes your issue? 🙏

Works great! Thanks 🙌

GamingBuddy-Agrume-sticker.MP4

Happy to hear that! I'll merge it right away and publish a new release. Thanks