-
Notifications
You must be signed in to change notification settings - Fork 67
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
Problem with MenuItemAction vs. Selectors #16
Comments
We built an epub reader using WKWebView (uiwebview leaks memory), and we have a similar UIMenuKit creates actions with a fixed name, so you can filter them like this
essentially I'm allowing all the menuitemkit actions through. You could possibly do custom naming of actions instead of random names the constructor could be changed to inject an identifier - see here |
Now exposing this method from MenuItemKit, version 2.0.2. |
I dont think this is quite what @danfsd was looking for :) this only tells us if a selector is a menuitemkit selector - it doesnt tell us what the selector is. We need someway to identify a specific selector's functionality. In his example he was checking In order to do this we would need to be able to identify UIMenuItemAction's with a specific identifier |
Can you explain me how can we check if a selector is a menuitemkit selector in CanPerformAction ? |
One temporary solution is to create a function which creates a We can argue whether comparing the action in the |
Considering adding this way in future version. |
Actully My problem is CanPerformAction method is not getting called for custom menuitem selectors using WebView. |
Now you can use |
I'm working on a fork of FolioReaderKit and your library is used there.
As a way of "filtering" which actions will be displayed on each scenario it was chosen to override the function
canPerformAction
of theUIWebView
. There they verify each action (which is aSelector
) and see if the item will end up displaying on the screen.Like this:
The thing is that most of those actions are actually a
Selector
and were created using the default API like this:When using your API for creating items with images we end up sending
MenuItemAction
instead ofSelectors
:Thus it's very hard to work combined with
canPerformAction
(which has aSelector
as parameter)Any suggestions of filtering which
UIMenuItem
(created with images, usingMenuItemAction
) will appear on a specific scenario?The text was updated successfully, but these errors were encountered: