jonathantribouharet / JTCalendar

A customizable calendar view for iOS.
MIT License
2.76k stars 531 forks source link

Find the height of a calendar cell #370

Open Aleph72 opened 6 years ago

Aleph72 commented 6 years ago

Hi, I need to find the height of the current month's day cell, where can I get it? Right now I've tried to get it from JTCalendarDayView.m:

in the method -(void)layoutSubviews

if (_isFirstDay) {
        CGRect newFrame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width * 2, self.frame.size.height);
        self.frame = newFrame;
    }

self.cellHeight = self.frame.size.height;

self.cellHeight is a new property that I've added to the class.

Then I get this value in my own class, method - (void)calendar:(JTCalendarManager )calendar prepareDayView:(JTCalendarDayView )dayView

The problem is that this last method gets called for each day of the current, previous and next month, but I need to show the cells' height of the current month only.

Any idea how to do this?