Files
comaps/iphone/DatePicker/DatePicker/CalendarLayout.swift
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
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
2025-05-08 21:10:51 +07:00

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
}
}