Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Provide a config which disables the readers UIMenuController #154

Merged
4 changes: 0 additions & 4 deletions Source/FolioReaderPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,6 @@ public class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGesture
// MARK: UIMenu visibility

override public func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
guard readerConfig.useReaderMenuController else {
return false
}

if UIMenuController.sharedMenuController().menuItems?.count == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can I think you should not remove the guard, because it will call the create menu, the idea is just to call super instead inside the guard.

For customization you can override this without problems.

webView.isColors = false
webView.createMenu(options: false)
Expand Down