Hide EventViewer on non-iPhone devices
rakuyoMo opened this issue · comments
Describe the bug
There may be no good way to hide EventViewer at the moment. As far as I understand, style.timeline.widthEventViewer = nil
is equivalent to hiding EventViewer because it is an optional value type, rather than widthEventViewer = 0
.
But because of the following code:
KVKCalendar/Sources/KVKCalendar/DayView.swift
Lines 319 to 321 in 7b0fdd1
It ignores widthEventViewer
when the device is in portrait orientation, resulting in a meaningless blank space on the right side of timelinePage
.
I think the following changes can be made:
- if isAvailableEventViewer {
+ if isAvailableEventViewer, let width = style.timeline.widthEventViewer {
if UIApplication.shared.orientation.isPortrait {
timelineFrame.size.width = UIScreen.main.bounds.width * 0.5
} else {
- timelineFrame.size.width -= style.timeline.widthEventViewer ?? 0
+ timelineFrame.size.width -= width
}
}
If you approve of this modification, I can submit a PR.
Sorry, I misread this question, please ignore it