From 452486b098fa9d6d0eaa04400ddacda4fdd1b13e Mon Sep 17 00:00:00 2001 From: WenchaoD Date: Thu, 20 Sep 2018 13:36:05 +0800 Subject: [PATCH] Remove unnecessary 'get' identifier of 'layoutAttributesClass' property of FSPagerViewLayout. --- Sources/FSPageViewLayout.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/FSPageViewLayout.swift b/Sources/FSPageViewLayout.swift index 69064e2..598ee15 100644 --- a/Sources/FSPageViewLayout.swift +++ b/Sources/FSPageViewLayout.swift @@ -17,9 +17,7 @@ class FSPagerViewLayout: UICollectionViewLayout { internal var scrollDirection: FSPagerView.ScrollDirection = .horizontal open override class var layoutAttributesClass: AnyClass { - get { - return FSPagerViewLayoutAttributes.self - } + return FSPagerViewLayoutAttributes.self } fileprivate var pagerView: FSPagerView? { @@ -143,6 +141,7 @@ class FSPagerViewLayout: UICollectionViewLayout { override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { let attributes = FSPagerViewLayoutAttributes(forCellWith: indexPath) + attributes.indexPath = indexPath let frame = self.frame(for: indexPath) let center = CGPoint(x: frame.midX, y: frame.midY) attributes.center = center