While implementing a feature to add dot marks to specific dates using FSCalendar and Realm, I encountered an issue: the dot marks only appeared after swiping to change the month view and then returning to the original month. Here’s a record of the solution for reference. (2022/1/20)
Environment:
OS: macOS Monterey ver 12.0.1
Xcode: Version 13.2.1
Swift: Version 5.5.2
Contents
Test 1
I tried setting the dot marks in tableView(_:willDisplay:forRowAt:).
- Reference: Stack Overflow – FSCalendar Event Dot Not Appearing
- Result: The dots only appeared after tapping on a cell.
- Cause: This suggested that I needed to adjust the timing for displaying the dot marks, such as considering
viewWillAppear.
Test 2
I changed the screen transition method from a modal to a push transition.
- Result: The dot marks successfully appeared when switching to a push transition.
- Reference Site: re35.org – FSCalendar Refresh
Source Code
Source Code: GitHub Repository
Final Thoughts
I hope this helps someone facing a similar issue!


Comments