Skip to content
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

How to hide Copy & Share options #191

Closed
ghost opened this issue Jul 16, 2020 · 7 comments · Fixed by readium/r2-navigator-swift#149
Closed

How to hide Copy & Share options #191

ghost opened this issue Jul 16, 2020 · 7 comments · Fixed by readium/r2-navigator-swift#149
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jul 16, 2020

How can we hide Copy and Share options when a text is selected in an epub file.

@mickael-menu
Copy link
Member

When creating an EPUBNavigatorViewController, you can provide an instance of EPUBNavigatorViewController.Configuration. The editingActions are used to set up which options appear in the selection menu.

let navigator = EPUBNavigatorViewController(
    ...,
    config: .init(
        editingActions: []
    )
) 

@ghost
Copy link

ghost commented Jul 17, 2020

Thanks. We tried this, but "Share" still shows up.

@mickael-menu
Copy link
Member

Okay, then I'll have to take a look. Can you tell me which versions of Readium, Xcode and iOS you're using?

@ghost
Copy link

ghost commented Jul 18, 2020

Thanks..Readium we used the one from the test app readme setup instructions..Xcode is latest 11.5 and iOS we are testing on the simulator iPhone SE (2nd Feb)

@mickael-menu
Copy link
Member

I probably won't have time to look at this for weeks unfortunately. If it's a blocking issue for you, please consider contributing a pull request.

It's supposed to work in WebView.swift by checking in canPerformAction() that the action is part of the EditingAction enum. For share, it's checking shareSelection:, but maybe the name of the selector changed in the latest iOS version.

@mickael-menu
Copy link
Member

I did a quick inspection, it looks like since iOS 13 the way we handle masking "Look Up" and "Share" doesn't work anymore.

There's the same issue on the PDF navigator, and here's a lead to fix this: https://stackoverflow.com/a/61361294/1474476

@mickael-menu mickael-menu added the bug Something isn't working label Jul 31, 2020
@rocxteady
Copy link
Contributor

I made a PR for this issue. -> readium/r2-navigator-swift#149
Can you check when you are avaiable? @mickael-menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants