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

Swift 4, iPhone X support and Carthage fixes #287

Merged
merged 56 commits into from
Jan 10, 2018

Conversation

paulocoutinhox
Copy link
Contributor

  • Swift 4 support
  • Carthage fixes

if let cell = collectionView.cellForItem(at: getCurrentIndexPath()) as? FolioReaderPage {
let cellSize = cell.frame.size

if let contentOffset = cell.webView?.scrollView.contentOffset {
Copy link
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.

if let contentOffset = cell.webView?.scrollView.contentOffset {
let contentOffsetX = contentOffset.x + cellSize.width

if let contentOffsetXLimit = cell.webView?.scrollView.contentSize.width {
Copy link
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.

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
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.

if let cell = collectionView.cellForItem(at: getCurrentIndexPath()) as? FolioReaderPage {
let cellSize = cell.frame.size

if let contentOffset = cell.webView?.scrollView.contentOffset {
Copy link
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
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