Make the scrolling check more succinct and readable

This commit is contained in:
Maurice Parker 2019-09-05 21:19:00 -05:00
parent a2dda5f0f8
commit 1e7ed5bf35

View File

@ -196,11 +196,7 @@ class DetailViewController: UIViewController {
let scrollToY: CGFloat = {
let fullScroll = webView.scrollView.contentOffset.y + webView.scrollView.bounds.size.height
let final = finalScrollPosition()
if fullScroll < final {
return fullScroll
} else {
return final
}
return fullScroll < final ? fullScroll : final
}()
let convertedPoint = self.view.convert(CGPoint(x: 0, y: 0), to: webView.scrollView)