-
Notifications
You must be signed in to change notification settings - Fork 772
Conversation
Highlight refactor
Refactor reader config
Hi @hebertialmeida ! So an internal PR will soon be reviewed and merged. It will fix the remaining issues and bugs. Best! |
Hi again @hebertialmeida, I'm opening another thread for that small question. I am not sure if this is a bug or feature. Best |
…ReaderKit into fork/master
Fix PR comments DBGIOS-1004
So, the |
The bar was not showing because now with `setup` function it add multiple times the recognizer to the view, now I remove everything before adding new one
Hey, @tschob and @kevindelord I take a general look at it, improved the animation of tabBar and fixed the bug of not showing it. The problem was that the gestured is added multiple times to the webView, so when you tap it to toggle the bar the number of times the gestures was added... Overall it LGTM, so I think we can merge that, take a look at my changes and let me know., then I will merge it. |
@hebertialmeida I don't fully understand why you changed the readerContainer to an optional: open weak var readerContainer: FolioReaderContainer? But otherwise it looks good to me. You can merge :) |
Source/FolioReaderCenter.swift
Outdated
return self.readerContainer.readerConfig | ||
fileprivate var folioReader: FolioReader { | ||
guard let readerContainer = readerContainer else { return FolioReader() } | ||
return self.readerContainer!.folioReader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like if you had kept the non-optional value this would not have been needed.
Plus you should use the value from the guard
instead of the self.readerContainer!.folioReader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, missed that...
Source/FolioReaderKit.swift
Outdated
|
||
/// Called when the application will resign active | ||
open class func applicationWillResignActive() { | ||
FolioReader.shared.saveReaderState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should keep that for the legacy? I mean when people update the library they could/should get a simple warning.
The function could be empty though, but at least it would still exist :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussed by Slack, there is no need for this.
Source/FolioReaderKit.swift
Outdated
|
||
/// Called when the application will terminate | ||
open class func applicationWillTerminate() { | ||
FolioReader.shared.saveReaderState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussed by Slack, there is no need for this.
fileprivate func addObservers() { | ||
removeObservers() | ||
NotificationCenter.default.addObserver(self, selector: #selector(saveReaderState), name: .UIApplicationWillResignActive, object: nil) | ||
NotificationCenter.default.addObserver(self, selector: #selector(saveReaderState), name: .UIApplicationWillTerminate, object: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this works fine with the multiple instances mode? Like the correct epub
gets saved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should because each observer is added to self
and it is a different object in memory.
Source/FolioReaderKit.swift
Outdated
|
||
/// Called when the application will resign active | ||
open class func applicationWillResignActive() { | ||
FolioReader.shared.saveReaderState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussed by Slack, there is no need for this.
Source/FolioReaderKit.swift
Outdated
|
||
/// Called when the application will terminate | ||
open class func applicationWillTerminate() { | ||
FolioReader.shared.saveReaderState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussed by Slack, there is no need for this.
@kevindelord @tschob Thank you guys, this is a huge improvement!! |
Implements multiple instances support. Solves #140
There is now a third example project which shows two instances in parallel.