Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #143 from readium/fix/alpha
Browse files Browse the repository at this point in the history
Various alpha fixes
  • Loading branch information
mickael-menu authored Oct 26, 2020
2 parents 228795f + bbeb1c3 commit e658b69
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

* Support for the new `Publication` model using the [Content Protection](https://readium.org/architecture/proposals/006-content-protection) for DRM rights and the [Fetcher](https://readium.org/architecture/proposals/002-composite-fetcher-api) for resource access.
* This replaces the `Container` and `DRMLicense` objects which were needed by the navigator before.

### Fixed

* Layout of right-to–left EPUB.
* [Various EPUB navigation issues](https://github.com/readium/r2-navigator-swift/pull/142):
* Prevent breaking initial location when calling `updateUserSettings` too soon.
* Fix weird scrolling behavior when double tapping on the edges to turn pages.
* Don't send intermediate incorrect locators when loading a pending locator.
* Optimize positions calculation for LCP protected PDF.

## [2.0.0-alpha.1]

### Added
Expand Down
4 changes: 3 additions & 1 deletion r2-navigator-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = Readium;
TargetAttributes = {
F3E7D3C21F4D83B000DF166D = {
Expand Down Expand Up @@ -373,6 +373,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -438,6 +439,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E7D3C21F4D83B000DF166D"
BuildableName = "R2Navigator.framework"
BlueprintName = "r2-navigator-swift"
ReferencedContainer = "container:r2-navigator-swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E7D3C21F4D83B000DF166D"
BuildableName = "R2Navigator.framework"
BlueprintName = "r2-navigator-swift"
ReferencedContainer = "container:r2-navigator-swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:r2-navigator-swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 2 additions & 0 deletions r2-navigator-swift/CBZ/CBZNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab
private let pageViewController: UIPageViewController

public init(publication: Publication, initialLocation: Locator? = nil) {
assert(!publication.isRestricted, "The provided publication is restricted. Check that any DRM was properly unlocked using a Content Protection.")

self.publication = publication
self.initialIndex = {
guard let initialLocation = initialLocation, let initialIndex = publication.readingOrder.firstIndex(withHREF: initialLocation.href) else {
Expand Down
10 changes: 6 additions & 4 deletions r2-navigator-swift/EPUB/EPUBNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ open class EPUBNavigatorViewController: UIViewController, VisualNavigator, Logga
private let resourcesURL: URL?

public init(publication: Publication, initialLocation: Locator? = nil, resourcesServer: ResourcesServer, config: Configuration = .init()) {
assert(!publication.isRestricted, "The provided publication is restricted. Check that any DRM was properly unlocked using a Content Protection.")

self.publication = publication
self.editingActions = EditingActionsController(actions: config.editingActions, rights: publication.rights)
self.userSettings = UserSettings()
Expand Down Expand Up @@ -662,7 +664,7 @@ extension EPUBNavigatorViewController: PaginationViewDelegate {
@available(*, deprecated, renamed: "EPUBNavigatorViewController")
public typealias NavigatorViewController = EPUBNavigatorViewController

@available(*, deprecated, message: "Use the `animated` parameter of `goTo` functions instead")
@available(*, unavailable, message: "Use the `animated` parameter of `goTo` functions instead")
public enum PageTransition {
case none
case animated
Expand All @@ -672,7 +674,7 @@ extension EPUBNavigatorViewController {

/// This initializer is deprecated.
/// `license` is not needed anymore.
@available(*, unavailable, renamed: "init(publication:license:initialLocation:resourcesServer:config:)")
@available(*, unavailable, renamed: "init(publication:initialLocation:resourcesServer:config:)")
public convenience init(publication: Publication, license: DRMLicense?, initialLocation: Locator? = nil, resourcesServer: ResourcesServer, config: Configuration = .init()) {
self.init(publication: publication, initialLocation: initialLocation, resourcesServer: resourcesServer, config: config)
}
Expand All @@ -681,7 +683,7 @@ extension EPUBNavigatorViewController {
/// Replace `pageTransition` by the `animated` property of the `goTo` functions.
/// Replace `disableDragAndDrop` by `EditingAction.copy`, since drag and drop is equivalent to copy.
/// Replace `initialIndex` and `initialProgression` by `initialLocation`.
@available(*, deprecated, renamed: "init(publication:license:initialLocation:resourcesServer:config:)")
@available(*, unavailable, renamed: "init(publication:initialLocation:resourcesServer:config:)")
public convenience init(for publication: Publication, license: DRMLicense? = nil, initialIndex: Int, initialProgression: Double?, pageTransition: PageTransition = .none, disableDragAndDrop: Bool = false, editingActions: [EditingAction] = EditingAction.defaultActions, contentInset: [UIUserInterfaceSizeClass: EPUBContentInsets]? = nil) {
fatalError("This initializer is not available anymore.")
}
Expand All @@ -698,7 +700,7 @@ extension EPUBNavigatorViewController {
self.init(publication: publication, initialLocation: initialLocation, resourcesServer: resourcesServer, config: config)
}

@available(*, deprecated, message: "Use the `animated` parameter of `goTo` functions instead")
@available(*, unavailable, message: "Use the `animated` parameter of `goTo` functions instead")
public var pageTransition: PageTransition {
get { return .none }
set {}
Expand Down
3 changes: 3 additions & 0 deletions r2-navigator-swift/PDF/PDFNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Loggab
private var tapGestureController: PDFTapGestureController?

public init(publication: Publication, initialLocation: Locator? = nil, editingActions: [EditingAction] = EditingAction.defaultActions) {
assert(!publication.isRestricted, "The provided publication is restricted. Check that any DRM was properly unlocked using a Content Protection.")

self.publication = publication
self.initialLocation = initialLocation
self.editingActions = EditingActionsController(actions: editingActions, rights: publication.rights)
Expand Down Expand Up @@ -361,6 +363,7 @@ extension PDFNavigatorViewController {

/// This initializer is deprecated.
/// `license` is not needed anymore.
@available(*, unavailable, renamed: "init(publication:initialLocation:editingActions:)")
public convenience init(publication: Publication, license: DRMLicense?, initialLocation: Locator? = nil, editingActions: [EditingAction] = EditingAction.defaultActions) {
self.init(publication: publication, initialLocation: initialLocation, editingActions: editingActions)
}
Expand Down

0 comments on commit e658b69

Please sign in to comment.