Skip to content

Commit

Permalink
refactor: rename function to better represent its functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
phuanggh committed Aug 29, 2023
1 parent 3d3ccde commit 315ceb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/KVKCalendar/MonthView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class MonthView: UIView {
headerViewFrame = customHeaderView.frame
addSubview(customHeaderView)
} else {
setHeaderTitle(date)
setHeaderTitleAndNotify(date)
}
}

Expand Down Expand Up @@ -171,7 +171,7 @@ final class MonthView: UIView {
return newMoveDate
}

private func setHeaderTitle(_ date: Date) {
private func setHeaderTitleAndNotify(_ date: Date) {
weekHeaderView.date = date
delegate?.didDisplayHeaderTitle(date, style: style, type: .month)
}
Expand Down Expand Up @@ -423,7 +423,7 @@ extension MonthView: UICollectionViewDelegate, UICollectionViewDelegateFlowLayou
guard let index = objectView.indexPathForItem(at: center) else { return }

let month = parameters.monthData.data.months[index.section]
setHeaderTitle(month.date)
setHeaderTitleAndNotify(month.date)
guard style.month.autoSelectionDateWhenScrolling else { return }
let newDate = parameters.monthData.findNextDateInMonth(month)
guard parameters.monthData.date != newDate else { return }
Expand All @@ -447,7 +447,7 @@ extension MonthView: UICollectionViewDelegate, UICollectionViewDelegateFlowLayou
}

let month = parameters.monthData.data.months[visibleIndex]
setHeaderTitle(month.date)
setHeaderTitleAndNotify(month.date)
guard style.month.autoSelectionDateWhenScrolling else { return }
let newDate = parameters.monthData.findNextDateInMonth(month)
guard parameters.monthData.date != newDate else { return }
Expand Down

0 comments on commit 315ceb6

Please sign in to comment.