mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-28 00:43:38 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
23 lines
760 B
Swift
23 lines
760 B
Swift
import UIKit
|
|
|
|
final class CalendarLayout: UICollectionViewFlowLayout {
|
|
override func prepare() {
|
|
super.prepare()
|
|
|
|
guard let collectionView = collectionView else { return }
|
|
let availableWidth = collectionView.bounds.width
|
|
minimumLineSpacing = 0
|
|
minimumInteritemSpacing = 0
|
|
let itemWidth = floor(availableWidth / 7)
|
|
let spaceLeft = availableWidth - itemWidth * 7
|
|
sectionInset = UIEdgeInsets(top: 0, left: spaceLeft / 2, bottom: 0, right: spaceLeft / 2)
|
|
itemSize = CGSize(width: itemWidth, height: itemWidth)
|
|
headerReferenceSize = CGSize(width: availableWidth, height: 80)
|
|
sectionHeadersPinToVisibleBounds = true
|
|
}
|
|
|
|
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
|
|
true
|
|
}
|
|
}
|