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

Commit

Permalink
2.0.0 (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu authored May 25, 2021
1 parent 8bf969b commit 3a1cbe1
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 40 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: swift
osx_image: xcode12.2
osx_image: xcode12.5
xcode_project: r2-navigator-swift.xcodeproj
xcode_scheme: r2-navigator-swift
xcode_destination: platform=iOS Simulator,OS=11.3,name=iPhone X
xcode_sdk: iphonesimulator13.0
xcode_destination: platform=iOS Simulator,OS=14.5.1,name=iPhone X
xcode_sdk: iphonesimulator14.5.1

branches:
only:
Expand All @@ -18,6 +18,11 @@ before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
- carthage bootstrap --verbose --no-use-binaries --use-xcframeworks --platform iOS --cache-builds
# The project expects .framework but we can only build XCFrameworks with Carthage on Xcode 12+.
# As a workaround, this will extract the .framework generated from the .xcframework files.
# See https://github.com/readium/r2-testapp-swift/issues/351#issuecomment-829250100
- mkdir -p Carthage/Build/iOS
- cp -r Carthage/Build/*.xcframework/ios-arm64_armv7/*.framework Carthage/Build/iOS

script:
- xcodebuild clean build -quiet
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ All notable changes to this project will be documented in this file.

<!--## [Unreleased]-->

## [2.0.0]

### Deprecated

* All APIs deprecated in previous versions are now unavailable.


## [2.0.0-beta.2]

### Added
Expand Down Expand Up @@ -74,3 +81,4 @@ progression. Now if no reading progression is set, the `effectiveReadingProgress
[2.0.0-alpha.2]: https://github.com/readium/r2-navigator-swift/compare/2.0.0-alpha.1...2.0.0-alpha.2
[2.0.0-beta.1]: https://github.com/readium/r2-navigator-swift/compare/2.0.0-alpha.2...2.0.0-beta.1
[2.0.0-beta.2]: https://github.com/readium/r2-navigator-swift/compare/2.0.0-beta.1...2.0.0-beta.2
[2.0.0]: https://github.com/readium/r2-navigator-swift/compare/2.0.0-beta.2...2.0.0
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "readium/r2-shared-swift" "develop"
github "readium/r2-shared-swift" == 2.0.0
github "scinfu/SwiftSoup" == 2.3.2
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "cezheng/Fuzi" "3.1.3"
github "dexman/Minizip" "1.4.0"
github "readium/r2-shared-swift" "d8b571d2ad66b2f7b7c44278e1269332b69559ab"
github "readium/r2-shared-swift" "2.0.0"
github "scinfu/SwiftSoup" "2.3.2"
2 changes: 1 addition & 1 deletion R2Navigator.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "R2Navigator"
s.version = "2.0.0-beta.2"
s.version = "2.0.0"
s.license = "BSD 3-Clause License"
s.summary = "R2 Navigator"
s.homepage = "http://readium.github.io"
Expand Down
2 changes: 1 addition & 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 = 1240;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = Readium;
TargetAttributes = {
F3E7D3C21F4D83B000DF166D = {
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 = "1240"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
14 changes: 7 additions & 7 deletions r2-navigator-swift/CBZ/CBZNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,32 +207,32 @@ extension CBZNavigatorViewController: UIPageViewControllerDelegate {

extension CBZNavigatorViewController {

@available(*, deprecated, renamed: "currentLocation.locations.position")
@available(*, unavailable, renamed: "currentLocation.locations.position")
public var pageNumber: Int {
return currentResourceIndex + 1
}

@available(*, deprecated, message: "Use `publication.readingOrder.count` instead")
@available(*, unavailable, message: "Use `publication.readingOrder.count` instead")
public var totalPageNumber: Int {
return publication.readingOrder.count
}

@available(*, deprecated, renamed: "goForward")
@available(*, unavailable, renamed: "goForward")
@objc public func loadNext() {
goForward(animated: true)
}

@available(*, deprecated, renamed: "goBackward")
@available(*, unavailable, renamed: "goBackward")
@objc public func loadPrevious() {
goBackward(animated: true)
}

@available(*, deprecated, message: "Use `go(to:)` using the `readingOrder` instead")
@available(*, unavailable, message: "Use `go(to:)` using the `readingOrder` instead")
public func load(at index: Int) {
goToResourceAtIndex(index, animated: true)
}

@available(*, deprecated, message: "Use init(publication:initialLocation:) instead")
@available(*, unavailable, message: "Use init(publication:initialLocation:) instead")
public convenience init(for publication: Publication, initialIndex: Int = 0) {
var location: Locator? = nil
if publication.readingOrder.indices.contains(initialIndex) {
Expand All @@ -243,5 +243,5 @@ extension CBZNavigatorViewController {

}

@available(*, deprecated, renamed: "CBZNavigatorViewController")
@available(*, unavailable, renamed: "CBZNavigatorViewController")
public typealias CbzNavigatorViewController = CBZNavigatorViewController
30 changes: 7 additions & 23 deletions r2-navigator-swift/EPUB/EPUBNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ extension EPUBNavigatorViewController: PaginationViewDelegate {

// MARK: - Deprecated

@available(*, deprecated, renamed: "EPUBNavigatorViewController")
@available(*, unavailable, renamed: "EPUBNavigatorViewController")
public typealias NavigatorViewController = EPUBNavigatorViewController

@available(*, unavailable, message: "Use the `animated` parameter of `goTo` functions instead")
Expand Down Expand Up @@ -746,25 +746,13 @@ extension EPUBNavigatorViewController {
set {}
}

@available(*, deprecated, message: "Bookmark model is deprecated, use your own model and `currentLocation`")
public var currentPosition: Bookmark? {
guard let publicationID = publication.metadata.identifier,
let locator = currentLocation,
let currentResourceIndex = currentResourceIndex else
{
return nil
}
return Bookmark(
publicationID: publicationID,
resourceIndex: currentResourceIndex,
locator: locator
)
}
@available(*, unavailable, message: "Bookmark model is deprecated, use your own model and `currentLocation`")
public var currentPosition: Bookmark? { nil }

@available(*, deprecated, message: "Use `publication.readingOrder` instead")
@available(*, unavailable, message: "Use `publication.readingOrder` instead")
public func getReadingOrder() -> [Link] { return publication.readingOrder }

@available(*, deprecated, message: "Use `publication.tableOfContents` instead")
@available(*, unavailable, message: "Use `publication.tableOfContents` instead")
public func getTableOfContents() -> [Link] { return publication.tableOfContents }

@available(*, unavailable, renamed: "go(to:)")
Expand All @@ -773,11 +761,7 @@ extension EPUBNavigatorViewController {
@available(*, unavailable, renamed: "go(to:)")
public func displayReadingOrderItem(at index: Int, progression: Double) {}

@available(*, deprecated, renamed: "go(to:)")
public func displayReadingOrderItem(with href: String) -> Int? {
let index = publication.readingOrder.firstIndex(withHref: href)
let moved = go(to: Link(href: href))
return moved ? index : nil
}
@available(*, unavailable, renamed: "go(to:)")
public func displayReadingOrderItem(with href: String) -> Int? { nil }

}
2 changes: 1 addition & 1 deletion r2-navigator-swift/EPUB/EPUBSpreadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import R2Shared
import SwiftSoup


protocol EPUBSpreadViewDelegate: class {
protocol EPUBSpreadViewDelegate: AnyObject {

/// Called when the user tapped on the spread contents.
func spreadView(_ spreadView: EPUBSpreadView, didTapAt point: CGPoint)
Expand Down
2 changes: 1 addition & 1 deletion r2-navigator-swift/Toolkit/PaginationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension PageView {

}

protocol PaginationViewDelegate: class {
protocol PaginationViewDelegate: AnyObject {
/// Creates the page view for the page at given index.
func paginationView(_ paginationView: PaginationView, pageViewAtIndex index: Int) -> (UIView & PageView)?

Expand Down

0 comments on commit 3a1cbe1

Please sign in to comment.