-
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
Conversation
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.
Про магические числа на твое усмотрение, но комментарии бы не помешали. К timeOnly и minDate
@@ -22,4 +22,15 @@ extension Date { | |||
func year() -> Int { | |||
return Calendar.current.component(.year, from: self) | |||
} | |||
|
|||
func timeOnly() -> Float { |
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?
if let yToScroll = timeline.currentTimeYPosition { | ||
setTimelineOffset(CGPoint(x: contentOffset.x, y: yToScroll - padding), animated: animated) | ||
} | ||
let timeToScroll = Date().timeOnly() - 4 |
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.
Тут еще какие-то магические 4 единицы чего-то отнимаются...
} | ||
|
||
private func setTimelineOffset(_ offset: CGPoint, animated: Bool) { | ||
let yToScroll = offset.y | ||
let bottomOfScrollView = contentSize.height - bounds.size.height | ||
let bottomOfScrollView = contentSize.height - bounds.size.height + 30 |
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.
Опять магическая цифра)
@@ -43,6 +43,8 @@ public final class TimelinePagerView: UIView, UIGestureRecognizerDelegate, UIScr | |||
} | |||
|
|||
public var autoScrollToFirstEvent = false | |||
|
|||
public var minDate: Date? |
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.
Добавить бы комментарий с описанием, что это за минимальная дата и для чего она используется
No description provided.