You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implement to support multiple section ,just changed some lime of code in "override open func prepare()" method. Just replace the for loop with the below code;
But I am not able to add Custom Header for section. Please help me to do this. Thanks in advance.
for section in 0 ..< collectionView!.numberOfSections {
for item in 0 ..< collectionView!.numberOfItems(inSection: section) {
let indexPath = IndexPath(item: item, section: section)
let height = cellPadding + staticCellHeight
let frame = CGRect(x: xOffsets[column], y: yOffset[column], width: columnWidth, height: height)
let insetFrame = frame.insetBy(dx: cellPadding, dy: cellPadding)
let attributes = DisplaySwitchLayoutAttributes(forCellWith: indexPath)
attributes.frame = insetFrame
baseLayoutAttributes.append(attributes)
contentHeight = max(contentHeight, frame.maxY)
yOffset[column] = yOffset[column] + height
column = column == (numberOfColumns - 1) ? 0 : column + 1
}
}
multiple sections are not handled by the layout. Best.
The text was updated successfully, but these errors were encountered: