Skip to content

Commit 047a5ba

Browse files
committed
Fixes iOS 13 reverting back to Times New Roman when changing the font size of default system fonts
1 parent c6f317c commit 047a5ba

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

FSCalendar/FSCalendarAppearance.m

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,52 @@ - (instancetype)init
2929
{
3030
self = [super init];
3131
if (self) {
32-
32+
3333
_titleFont = [UIFont systemFontOfSize:FSCalendarStandardTitleTextSize];
3434
_subtitleFont = [UIFont systemFontOfSize:FSCalendarStandardSubtitleTextSize];
3535
_weekdayFont = [UIFont systemFontOfSize:FSCalendarStandardWeekdayTextSize];
3636
_headerTitleFont = [UIFont systemFontOfSize:FSCalendarStandardHeaderTextSize];
37-
37+
3838
_headerTitleColor = FSCalendarStandardTitleTextColor;
3939
_headerDateFormat = @"MMMM yyyy";
4040
_headerMinimumDissolvedAlpha = 0.2;
4141
_weekdayTextColor = FSCalendarStandardTitleTextColor;
4242
_caseOptions = FSCalendarCaseOptionsHeaderUsesDefaultCase|FSCalendarCaseOptionsWeekdayUsesDefaultCase;
43-
43+
4444
_backgroundColors = [NSMutableDictionary dictionaryWithCapacity:5];
4545
_backgroundColors[@(FSCalendarCellStateNormal)] = [UIColor clearColor];
4646
_backgroundColors[@(FSCalendarCellStateSelected)] = FSCalendarStandardSelectionColor;
4747
_backgroundColors[@(FSCalendarCellStateDisabled)] = [UIColor clearColor];
4848
_backgroundColors[@(FSCalendarCellStatePlaceholder)] = [UIColor clearColor];
4949
_backgroundColors[@(FSCalendarCellStateToday)] = FSCalendarStandardTodayColor;
50-
50+
5151
_titleColors = [NSMutableDictionary dictionaryWithCapacity:5];
5252
_titleColors[@(FSCalendarCellStateNormal)] = [UIColor blackColor];
5353
_titleColors[@(FSCalendarCellStateSelected)] = [UIColor whiteColor];
5454
_titleColors[@(FSCalendarCellStateDisabled)] = [UIColor grayColor];
5555
_titleColors[@(FSCalendarCellStatePlaceholder)] = [UIColor lightGrayColor];
5656
_titleColors[@(FSCalendarCellStateToday)] = [UIColor whiteColor];
57-
57+
5858
_subtitleColors = [NSMutableDictionary dictionaryWithCapacity:5];
5959
_subtitleColors[@(FSCalendarCellStateNormal)] = [UIColor darkGrayColor];
6060
_subtitleColors[@(FSCalendarCellStateSelected)] = [UIColor whiteColor];
6161
_subtitleColors[@(FSCalendarCellStateDisabled)] = [UIColor lightGrayColor];
6262
_subtitleColors[@(FSCalendarCellStatePlaceholder)] = [UIColor lightGrayColor];
6363
_subtitleColors[@(FSCalendarCellStateToday)] = [UIColor whiteColor];
64-
64+
6565
_borderColors[@(FSCalendarCellStateSelected)] = [UIColor clearColor];
6666
_borderColors[@(FSCalendarCellStateNormal)] = [UIColor clearColor];
67-
67+
6868
_borderRadius = 1.0;
6969
_eventDefaultColor = FSCalendarStandardEventDotColor;
7070
_eventSelectionColor = FSCalendarStandardEventDotColor;
71-
71+
7272
_borderColors = [NSMutableDictionary dictionaryWithCapacity:2];
73-
73+
7474
#if TARGET_INTERFACE_BUILDER
7575
_fakeEventDots = YES;
7676
#endif
77-
77+
7878
}
7979
return self;
8080
}
@@ -492,22 +492,22 @@ - (FSCalendarCellShape)cellShape
492492

493493
- (void)setTitleTextSize:(CGFloat)titleTextSize
494494
{
495-
self.titleFont = [UIFont fontWithName:self.titleFont.fontName size:titleTextSize];
495+
self.titleFont = [self.titleFont fontWithSize:titleTextSize];
496496
}
497497

498498
- (void)setSubtitleTextSize:(CGFloat)subtitleTextSize
499499
{
500-
self.subtitleFont = [UIFont fontWithName:self.subtitleFont.fontName size:subtitleTextSize];
500+
self.subtitleFont = [self.subtitleFont fontWithSize:subtitleTextSize];
501501
}
502502

503503
- (void)setWeekdayTextSize:(CGFloat)weekdayTextSize
504504
{
505-
self.weekdayFont = [UIFont fontWithName:self.weekdayFont.fontName size:weekdayTextSize];
505+
self.weekdayFont = [self.weekdayFont fontWithSize:weekdayTextSize];
506506
}
507507

508508
- (void)setHeaderTitleTextSize:(CGFloat)headerTitleTextSize
509509
{
510-
self.headerTitleFont = [UIFont fontWithName:self.headerTitleFont.fontName size:headerTitleTextSize];
510+
self.headerTitleFont = [self.headerTitleFont fontWithSize:headerTitleTextSize];
511511
}
512512

513513
- (void)invalidateAppearance

0 commit comments

Comments
 (0)