Skip to content

Commit

Permalink
With this return value, developers can add any decoration view for JT…
Browse files Browse the repository at this point in the history
…CalendarMenuView
  • Loading branch information
uck729 committed Oct 19, 2016
1 parent 173452d commit a143d1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion JTCalendar/Views/JTCalendarMenuView.h
Expand Up @@ -22,5 +22,5 @@
*/
- (void)commonInit;

- (UIView*)centerView;
- (CGSize)centerTextSize;
@end
9 changes: 7 additions & 2 deletions JTCalendar/Views/JTCalendarMenuView.m
Expand Up @@ -73,9 +73,14 @@ - (void)commonInit
}
}

- (UIView*)centerView
- (CGSize)centerTextSize
{
return _centerView;
if (_centerView && [_centerView isKindOfClass:[UILabel class]])
{
UILabel* label = (UILabel*)_centerView;
return [label.text sizeWithAttributes:@{NSFontAttributeName:[label font]}];
}
return CGSizeZero;
}

- (void)layoutSubviews
Expand Down

0 comments on commit a143d1b

Please sign in to comment.