Search code examples
iosxamarincalendardelegatesfscalendar

Set FSCalendarAppearance delegate in iOS Xamarin Native


Im trying to implement a calendar using FSCalendar for iOS. https://github.com/MarcBruins/FSCalendar-Xamarin-iOS https://www.cocoacontrols.com/controls/fscalendar

I've got the calendar working but am unable to get enable appearance delegate methods (FSCalendarDelegateAppearance) in order to customise individual cells.

Also, though I am able to create CalendarAppearance object, I am unable to attach it to the calendar. Any help is appreciated.

Thanks


Solution

  • Got it, it can be done by setting

    calendar.WeakDelegate = this;
    

    and then using for both appearanceDelegate and delegate methods like

    [Export("calendar:appearance:fillDefaultColorForDate:")]
            public UIColor FillDefaultColorForDate(FSCalendar calendar, FSCalendarAppearance appearance, NSDate date)
            {
                return UIColor.White;
            }