Skip to content

calendar.isReloadData() is not working #1457

@ruchit-kalathiya-git

Description

@ruchit-kalathiya-git

I am using FSCalendar in SwiftUI and I am updating CalenderView on change of reloadData ehere reloadData is @State variable.
Here FSCalendar.reoadData() is not refreshing view or triggering willDisplay methods.
Here is updateUIView snippet.

func updateUIView(_ uiView: FSCalendar, context: Context) {
        if uiView.scope != calendarScope {
            if calendarScope == .week {
                UIView.animate(withDuration: 0.3) {
                    DispatchQueue.main.async {
                        uiView.setScope(self.calendarScope, animated: true)
                    }
                }
            } else {
                UIView.animate(withDuration: 0.3) {
                    DispatchQueue.main.async {
                        uiView.scope = .month
                    }
                }
            }
        }
        
        if reloadData {
            DispatchQueue.main.async {
                uiView.reloadData()
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions