-
Notifications
You must be signed in to change notification settings - Fork 772
Swift 4, iPhone X support and Carthage fixes #287
Conversation
paulocoutinhox
commented
Dec 7, 2017
- Swift 4 support
- Carthage fixes
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 { |
There was a problem hiding this comment.
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.
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 { |
There was a problem hiding this comment.
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.
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 { |
There was a problem hiding this comment.
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.
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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, and with docs 👍