Skip to content

Commit

Permalink
re-Added concept of anchor dates on reloadData again
Browse files Browse the repository at this point in the history
  • Loading branch information
patchthecode committed Jun 19, 2017
1 parent 9f42dd2 commit b81158d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/JTAppleCalendarLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -727,5 +727,6 @@ class JTAppleCalendarLayout: UICollectionViewLayout, JTAppleCalendarLayoutProtoc
contentHeight = 0
contentWidth = 0
stride = 0
firstContentOffsetWasSet = false
}
}
3 changes: 2 additions & 1 deletion Sources/UserInteractionFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extension JTAppleCalendarView {
/// - Parameter animation: Scroll is animated if this is set to true
/// - Parameter completionHandler: This closure will run after
/// the reload is complete
public func reloadData(completionHandler: (() -> Void)? = nil) {
public func reloadData(withanchor date: Date? = nil, completionHandler: (() -> Void)? = nil) {
if isScrollInProgress || isReloadDataInProgress {
delayedExecutionClosure.append {[unowned self] in
self.reloadData(completionHandler: completionHandler)
Expand All @@ -168,6 +168,7 @@ extension JTAppleCalendarView {
}

isReloadDataInProgress = true
initialScrollDate = date

let selectedDates = self.selectedDates
let layoutNeedsUpdating = reloadDelegateDataSource()
Expand Down

0 comments on commit b81158d

Please sign in to comment.