Browse Source

Using constant.

pull/101/head
Abhishek 4 years ago
parent
commit
5251b8fee3
  1. 4
      Clocker/Panel/ParentPanelController+ModernSlider.swift
  2. 1
      Clocker/Panel/ParentPanelController.swift

4
Clocker/Panel/ParentPanelController+ModernSlider.swift

@ -5,7 +5,7 @@ import Foundation
extension ParentPanelController: NSCollectionViewDataSource {
func collectionView(_: NSCollectionView, numberOfItemsInSection _: Int) -> Int {
return (96 * PanelConstants.modernSliderDaySupport * 2) + 1
return (PanelConstants.modernSliderPointsInADay * PanelConstants.modernSliderDaySupport * 2) + 1
}
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
@ -92,7 +92,7 @@ extension ParentPanelController {
}
public func setDefaultDateLabel(_ index: Int) -> Int {
let totalCount = (96 * PanelConstants.modernSliderDaySupport * 2) + 1
let totalCount = (PanelConstants.modernSliderPointsInADay * PanelConstants.modernSliderDaySupport * 2) + 1
let centerPoint = Int(ceil(Double(totalCount / 2)))
if index > (centerPoint + 1) {
let remainder = (index % (centerPoint + 1))

1
Clocker/Panel/ParentPanelController.swift

@ -12,6 +12,7 @@ struct PanelConstants {
static let yesWithQuestionMark = "Yes?"
static let yesWithExclamation = "Yes!"
static let modernSliderDaySupport = 5
static let modernSliderPointsInADay = 96
}
class ParentPanelController: NSWindowController {

Loading…
Cancel
Save