Fixed issue #164, #186 and #173#219
Conversation
| } | ||
|
|
||
| extension FolioReaderContainer { | ||
| func alert(message: String) { |
There was a problem hiding this comment.
What do you think creating an extension of UIAlertController and move this method inside it?
There was a problem hiding this comment.
@PravinNagargoje I use your fork but still crash when highlight.
There was a problem hiding this comment.
@Julyyq this handle errors from readEpub(), readContainer() and readOpf(). In your case error might be from somewhere else. If you are talking about paragraph highlight, it's still not solved.
| style: UIAlertActionStyle.cancel | ||
| ) | ||
| { | ||
| (result : UIAlertAction) -> Void in |
There was a problem hiding this comment.
What do you think of using [weak self] here?
There was a problem hiding this comment.
I don't think it will be necessary. But still I have added it.
| @@ -150,6 +150,7 @@ extension Highlight { | |||
| highlight?.type = type.hashValue | |||
|
|
|||
| try realm.commitWrite() | |||
There was a problem hiding this comment.
Maybe it is a good idea to use guard let to create a Realm
Maybe changing realm.beginWrite() to realm.write { } will be better. Will prevent screen locking.
There was a problem hiding this comment.
You are right. It might lead to screen locking.
I have made changes.
| let coverImageId = book.metadata.findMetaByName("cover") | ||
| if let coverResource = book.resources.findById(coverImageId) { | ||
| book.coverImage = coverResource | ||
| } else if let coverResource = book.resources.findByProperties("cover-image") { |
There was a problem hiding this comment.
What do you think changing findByProperties to findByProperty?
There was a problem hiding this comment.
Changed to findByProperty.
| @@ -108,8 +108,6 @@ open class FolioReaderWebView: UIWebView { | |||
| let startOffset = dic["startOffset"]! | |||
| let endOffset = dic["endOffset"]! | |||
There was a problem hiding this comment.
made all the changes as you requested and made PR.
|
@PravinNagargoje Thank you, many improvements here! |
This pull request is related to issue -
https://github.com/FolioReader/FolioReaderKit/issues/164
Changes commited on 15 march are related to issue -
https://github.com/FolioReader/FolioReaderKit/issues/186
Changes commited on 17 march solve issue -
https://github.com/FolioReader/FolioReaderKit/issues/173
I have added throw-catch and few custom FolioReader errors for first issue and solved the highlight problem.