forked from richardtop/CalendarKit
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intergation custom table view to vc #4
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c6442c0
Scroll to current time minus 4 hours
igover 91eca48
Scroll to current time minus 4 hours (implemented)
igover f710bbd
Change events gap (in case if second event starts in the end time of …
igover 1dcac2c
Added min date for Public API
igover 5af918a
Fix logic for min date
igover 4d4c923
Fix scroll to current time method
igover File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ public protocol TimelinePagerViewDelegate: AnyObject { | |
|
||
final class CKPageViewController: UIPageViewController { | ||
var commonOffset: CGPoint? | ||
var isFirstLaunch = true | ||
var timeIntervalBefore: Float = .zero | ||
} | ||
|
||
public final class TimelinePagerView: UIView, UIGestureRecognizerDelegate, UIScrollViewDelegate, DayViewStateUpdating, UIPageViewControllerDataSource, UIPageViewControllerDelegate, TimelineViewDelegate { | ||
|
@@ -43,6 +45,16 @@ public final class TimelinePagerView: UIView, UIGestureRecognizerDelegate, UIScr | |
} | ||
|
||
public var autoScrollToFirstEvent = false | ||
|
||
/// Min date in calendar for swipe | ||
public var minDate: Date? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавить бы комментарий с описанием, что это за минимальная дата и для чего она используется |
||
|
||
/// Time interval before current time | ||
public var timeIntervalBefore: Float = .zero { | ||
didSet { | ||
pagingViewController.timeIntervalBefore = timeIntervalBefore | ||
} | ||
} | ||
|
||
private var pagingViewController = CKPageViewController(transitionStyle: .scroll, | ||
navigationOrientation: .horizontal, | ||
|
@@ -455,7 +467,6 @@ public final class TimelinePagerView: UIView, UIGestureRecognizerDelegate, UIScr | |
completion: nil) | ||
|
||
self.pagingViewController.viewControllers?.first?.view.setNeedsLayout() | ||
self.scrollToFirstEventIfNeeded(animated: true) | ||
self.delegate?.timelinePager(timelinePager: self, didMoveTo: newDate) | ||
} | ||
} | ||
|
@@ -500,6 +511,9 @@ public final class TimelinePagerView: UIView, UIGestureRecognizerDelegate, UIScr | |
public func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { | ||
guard let containerController = viewController as? TimelineContainerController else { return nil } | ||
let previousDate = calendar.date(byAdding: .day, value: -1, to: containerController.timeline.date)! | ||
if let minDate = minDate { | ||
guard previousDate >= minDate else { return nil } | ||
} | ||
let timelineContainerController = configureTimelineController(date: previousDate) | ||
let offset = containerController.container.contentOffset | ||
timelineContainerController.pendingContentOffset = offset | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
честно сказать, так и не понял, что этот метод возвращает... Float... Time... В каких единицах измерения возвращается timeOnly?