Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Swift 4, iPhone X support and Carthage fixes#287

Merged
hebertialmeida merged 56 commits into
FolioReader:masterfrom
ubook-editora:swift4
Jan 10, 2018
Merged

Swift 4, iPhone X support and Carthage fixes#287
hebertialmeida merged 56 commits into
FolioReader:masterfrom
ubook-editora:swift4

Conversation

@paulocoutinhox
Copy link
Copy Markdown

  • Swift 4 support
  • Carthage fixes

Comment thread Source/FolioReaderCenter.swift Outdated
if let cell = collectionView.cellForItem(at: getCurrentIndexPath()) as? FolioReaderPage {
let cellSize = cell.frame.size

if let contentOffset = cell.webView?.scrollView.contentOffset {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use guard let here to reduce the chaining.

Comment thread Source/FolioReaderCenter.swift Outdated
if let contentOffset = cell.webView?.scrollView.contentOffset {
let contentOffsetX = contentOffset.x + cellSize.width

if let contentOffsetXLimit = cell.webView?.scrollView.contentSize.width {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use guard let here to reduce the chaining.

Comment thread Source/FolioReaderCenter.swift Outdated
public func changePageItemToPrevious(_ completion: (() -> Void)? = nil) {
// TODO: It was implemented for horizontal orientation.
// Need check page orientation (v/h) and make correct calc for vertical
if let cell = collectionView.cellForItem(at: getCurrentIndexPath()) as? FolioReaderPage {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use guard let here to reduce the chaining.

Comment thread Source/FolioReaderCenter.swift Outdated
if let cell = collectionView.cellForItem(at: getCurrentIndexPath()) as? FolioReaderPage {
let cellSize = cell.frame.size

if let contentOffset = cell.webView?.scrollView.contentOffset {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use guard let here to reduce the chaining.


- parameter recognizer: The tap recognizer
*/
@objc optional func pageTap(_ recognizer: UITapGestureRecognizer)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, and with docs 👍

@hebertialmeida hebertialmeida self-assigned this Dec 19, 2017
@hebertialmeida hebertialmeida changed the title Swift 4 support and Carthage fixes Swift 4, iPhone X support and Carthage fixes Dec 19, 2017
@hebertialmeida hebertialmeida merged commit 1cd304a into FolioReader:master Jan 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants