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
Question: Didn't get highlighted text. #128
Comments
|
Thank you very much @mickael-menu |
@mickael-menu |
Did you try this after selecting some text? @objc func highlight(_ sender: Any) {
print(epubNavigator.currentSelection?.locator)
} If it still doesn't work, create a new issue following the Bug Report issue template with a sample EPUB having the problem and a screenshot of your text selection. |
yes. @mickael-menu http://files.simformsolutions.com.s3.amazonaws.com/simformscreen/screencast_2021-09-16_15-52-14.mp4 |
@mickael-menu � |
What is this |
Hey @mickael-menu |
Also @mickael-menu when I use develop branch code then book stop rendering. |
Ha you're right, I thought it was released already. Then getting the highlighted text is not supported yet (in a release). You can't use a |
Okey @mickael-menu . let me try with |
after changing all Readium modules to |
@mickael-menu |
I don't know, this issue is honestly too vague to help you out. Try debugging to see where it comes from. I would avoid subclassing |
Currently, I am not subclassing |
@vishalpatel-simformsolutions if you're using R2 Test App and you've already added custom highlight Menu Action via var config = EPUBNavigatorViewController.Configuration()
config.editingActions = EditingAction.defaultActions
config.editingActions.append(EditingAction(title: "Highlight", action: #selector(highlight(_:))))
let navigator = EPUBNavigatorViewController(publication: publication, initialLocation: locator, resourcesServer: resourcesServer, config: config) Here is working example of text highlighting using menu. @objc func highlight(_ sender: Any) {
guard let selection = epubNavigator.currentSelection else {
return
}
print("highlight: \(selection)")
if let text = selection.locator.text.highlight {
epubNavigator.apply(decorations: [Decoration(id: Decoration.Id(), locator: selection.locator, style: Decoration.Style.highlight())], in: text)
}
} |
thank you @emartinson . It worked with develop branch. |
Hey,
I want to get Highlighted text in EPUBViewController.
So I have added custom editAction
var config = EPUBNavigatorViewController.Configuration() config.editingActions.append(EditingAction(title: "Highlight", action: #selector(highlight)))
@objc func highlight(_ sender: Any) { print(epubNavigator.currentLocation?.text.highlight) }
The text was updated successfully, but these errors were encountered: