This repository was archived by the owner on Nov 26, 2020. It is now read-only.
Provide a way to perform java script code in a readers page from external code#155
Merged
hebertialmeida merged 4 commits intoSep 23, 2016
Merged
Conversation
hebertialmeida
suggested changes
Sep 22, 2016
Member
hebertialmeida
left a comment
There was a problem hiding this comment.
Why do you think is better to subclass the UIWebView instead of a extension, as it is not public to override?
|
|
||
| UIView.animateWithDuration(0.2, animations: {webView.alpha = 1}) { finished in | ||
| webView.isColors = false | ||
| (webView as? FolioReaderWebView)?.isColors = false |
Member
There was a problem hiding this comment.
Lets reduce the (webView as? FolioReaderWebView) cast, we can just cast with guard on beginning of the function.
guard let webView = webView as? FolioReaderWebView else { return }Then just use webView as previously.
Member
Author
There was a problem hiding this comment.
Yes this seems to be the better approach, I'll adjust it.
| webView.createMenu(options: true) | ||
| webView.setMenuVisible(true, andRect: rect) | ||
| (webView as? FolioReaderWebView)?.createMenu(options: true) | ||
| (webView as? FolioReaderWebView)?.setMenuVisible(true, andRect: rect) |
Member
There was a problem hiding this comment.
Same for casting here and so on...
Member
Author
|
I think it's better to use a subclass instead of an extension because:
|
hebertialmeida
approved these changes
Sep 23, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
UIWebViewextension to the subclassFolioReaderWebViewFolioReaderPage