CalendarView

class CalendarView : UIView, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout

Calendar View

  • Collection view

    Declaration

    Swift

    private let collectionView: UICollectionView
  • Overlay

    Declaration

    Swift

    private let overlay: MonthOverlayView
  • Did load view

    Declaration

    Swift

    private var didLoad: Bool
  • Has scrolled to today

    Declaration

    Swift

    private var hasScrolledToToday: Bool
  • Delegate

    Declaration

    Swift

    weak var delegate: CalendarViewDelegate?
  • Total width of view, set this before adding to superview

    Declaration

    Swift

    var totalWidth: CGFloat
  • Event service

    Declaration

    Swift

    private let eventService: EventService
  • Weather forecast, set this to show weather forecasts

    Declaration

    Swift

    var weatherForecast: WeatherForecastResponse? { get set }
  • Dates to display

    Declaration

    Swift

    var dates: CalendarDates { get set }
  • Selected date

    Declaration

    Swift

    var selectedDate: Date? { get set }
  • Item size

    Declaration

    Swift

    var itemSize: CGSize { get }
  • Given total width, calculate item size

    • param totalWidth: Total width

    Declaration

    Swift

    static func itemSizeForWidth(_ totalWidth: CGFloat) -> CGSize

    Return Value

    item size

  • Preferred collapsed height

    Declaration

    Swift

    var preferredCollapsedHeight: Float { get }
  • Preferred expanded height

    Declaration

    Swift

    var preferredExpandedHeight: Float { get }
  • Start overlay observers

    Declaration

    Swift

    private func startOverlayObservers()
  • Undocumented

    Declaration

    Swift

    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)
  • End overlay observers

    Declaration

    Swift

    private func endOverlayObservers()
  • Undocumented

    Declaration

    Swift

    override func didMoveToSuperview()
  • Undocumented

    Declaration

    Swift

    private func loadView()
  • Scroll to today if needed

    Declaration

    Swift

    private func scrollToTodayIfNeeded()
  • Scroll to selected date

    Declaration

    Swift

    func scrollToSelectedDate()
  • Reload data

    Declaration

    Swift

    private func reloadData()
  • Undocumented

    Declaration

    Swift

    override func layoutSubviews()
  • Update selected date

    Declaration

    Swift

    private func updateSelectedDate()
  • Redraw visible cells

    Declaration

    Swift

    private func redrawVisibileCells()
  • Undocumented

    Declaration

    Swift

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
  • Undocumented

    Declaration

    Swift

    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
  • Undocumented

    Declaration

    Swift

    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath)
  • Undocumented

    Declaration

    Swift

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize