Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. Take a look
#### Navigator

* PDF documents are now opened off the main thread, preventing UI freezes with large files.
* Fixed providing a custom reading order to the `EPUBNavigatorViewController` (contributed by [@lbeus](https://github.com/readium/swift-toolkit/pull/694)).


## [3.6.0]
Expand Down
3 changes: 2 additions & 1 deletion Sources/Navigator/EPUB/EPUBNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,15 @@ open class EPUBNavigatorViewController: InputObservableViewController,

let viewModel = try EPUBNavigatorViewModel(
publication: publication,
readingOrder: readingOrder ?? publication.readingOrder,
config: config,
httpServer: httpServer
)

self.init(
viewModel: viewModel,
initialLocation: initialLocation,
readingOrder: readingOrder ?? publication.readingOrder,
readingOrder: viewModel.readingOrder,
positionsByReadingOrder:
// Positions and total progression only make sense in the context
// of the publication's actual reading order. Therefore when
Expand Down
6 changes: 5 additions & 1 deletion Sources/Navigator/EPUB/EPUBNavigatorViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ final class EPUBNavigatorViewModel: Loggable {
/// `httpServer`. This is used to serve custom font files, for example.
@Atomic private var servedFiles: [FileURL: HTTPURL] = [:]

var readingOrder: ReadingOrder { publication.readingOrder }
let readingOrder: ReadingOrder

convenience init(
publication: Publication,
readingOrder: ReadingOrder,
config: EPUBNavigatorViewController.Configuration,
httpServer: HTTPServer
) throws {
Expand All @@ -55,6 +56,7 @@ final class EPUBNavigatorViewModel: Loggable {

try self.init(
publication: publication,
readingOrder: readingOrder,
config: config,
httpServer: httpServer,
publicationEndpoint: publicationEndpoint,
Expand Down Expand Up @@ -89,6 +91,7 @@ final class EPUBNavigatorViewModel: Loggable {

private init(
publication: Publication,
readingOrder: ReadingOrder,
config: EPUBNavigatorViewController.Configuration,
httpServer: HTTPServer?,
publicationEndpoint: HTTPServerEndpoint?,
Expand Down Expand Up @@ -123,6 +126,7 @@ final class EPUBNavigatorViewModel: Loggable {
}

self.publication = publication
self.readingOrder = readingOrder
self.config = config
editingActions = EditingActionsController(
actions: config.editingActions,
Expand Down