Post

Replies

Boosts

Views

Activity

Reply to MacOS Catalyst: how to allow double click on UIView to zoom window?
I was able to figure this out using a workaround. UIKit/Catalyst itself doesn't provide any way to do this. But I was able to use the second method outline in this post on the link in my answer on Stackoverflow: How to Access the AppKit API from Mac Catalyst Apps https://stackoverflow.com/questions/67067248/macos-catalyst-how-to-allow-double-click-on-uiview-to-zoom-window/67084666#67084666 I used the second method and not the first one as the first one seems to be private API (I could be wrong) and will get rejected in App Store. The second method of using a plugin bundle and calling methods on that works well for me. This way I was able to not just perform the zoom, I was also able to perform other MacOS Appkit functionality like listening for keyboard, mouse scroll, hover detection etc. After creating the plugin bundle, here's my code inside the plugin: Plugin.swift: } MacPlugin.swift: } Then I call this from my iOS app code. This adds a transparent view at the top where double clicking calls the plugin code for toggling zoom. NOTE that you must call this from viewDidAppear or somewhere when the windows have been initialized and presented. Otherwise it won't work. #endif Calling it from viewDidAppear: }
Apr ’21