Skip to content

Commit 2230802

Browse files
committed
commit new tag
1 parent 6c036c0 commit 2230802

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎CLCollectionViewFlowLayout.podspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "CLCollectionViewFlowLayout"
19-
s.version = "1.0.3"
19+
s.version = "1.0.4"
2020
s.summary = "CLCollectionViewFlowLayout."
2121

2222
# This description is used to generate tags and improve search results.

‎CLCollectionViewFlowLayout/CLCollectionViewFlowLayout/CLCollectionViewFlowLayout.swift‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CLCollectionViewFlowLayout: UICollectionViewFlowLayout {
1313
//MARK: - props
1414
//item动态宽高则必须实现该协议
1515
weak var delegate:UICollectionViewDelegateFlowLayout?
16-
16+
1717
private var itemAttributes = [UICollectionViewLayoutAttributes]()
1818
private var sectionHeaderAttributes = [UICollectionViewLayoutAttributes]()
1919
private var sectionFooterAttributes = [UICollectionViewLayoutAttributes]()
@@ -22,7 +22,7 @@ class CLCollectionViewFlowLayout: UICollectionViewFlowLayout {
2222
//MARK: - private method
2323
func layoutHeaderSectionAttris(at section:Int,x:CGFloat, y:CGFloat) -> UICollectionViewLayoutAttributes? {
2424
if let delegate = self.delegate {
25-
if delegate.responds(to: #selector(delegate.collectionView(_:layout:minimumLineSpacingForSectionAt:))) {
25+
if delegate.responds(to: #selector(delegate.collectionView(_:layout:referenceSizeForHeaderInSection:))) {
2626
let sectionSize = self.delegate!.collectionView!(collectionView!, layout: self, referenceSizeForHeaderInSection: section)
2727
var sectionHeight:CGFloat = 0
2828
if sectionSize != CGSize.zero {
@@ -76,9 +76,10 @@ class CLCollectionViewFlowLayout: UICollectionViewFlowLayout {
7676
var yOffset = self.sectionInset.top
7777
var yItemOffset = self.sectionInset.top
7878
for section in 0..<sectionCount {
79-
let headerAttris = self.layoutHeaderSectionAttris(at: section, x: xOffset, y: yOffset)
79+
let headerAttris = self.layoutHeaderSectionAttris(at: section, x: 0, y: yOffset)
8080
if headerAttris != nil {
8181
yOffset = headerAttris!.frame.maxY
82+
yItemOffset = headerAttris!.frame.maxY
8283
self.sectionHeaderAttributes.append(headerAttris!)
8384
}
8485
var pre:CLCollectionViewLayoutAttributes?
@@ -118,7 +119,7 @@ class CLCollectionViewFlowLayout: UICollectionViewFlowLayout {
118119
}
119120
yItemOffset = layoutAttributes.frame.minY
120121
}
121-
if let footerAttris = self.layoutFooterSectionAttris(at: section, x: self.sectionInset.left, y: yOffset) {
122+
if let footerAttris = self.layoutFooterSectionAttris(at: section, x: 0, y: yOffset) {
122123
yOffset = footerAttris.frame.maxY
123124
self.sectionFooterAttributes.append(footerAttris)
124125
}
@@ -185,5 +186,5 @@ class CLCollectionViewFlowLayout: UICollectionViewFlowLayout {
185186
return true
186187
}
187188

188-
189+
189190
}

0 commit comments

Comments
 (0)