UIFont+LIVE.m
851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// UIFont+LIVE.m
// yohoLive
//
// Created by jhsonzhi on 16/8/9.
// Copyright © 2016年 NewPower. All rights reserved.
//
#import "UIFont+LIVE.h"
@implementation UIFont (LIVE)
+ (UIFont *)fontOfLightWithSize:(CGFloat)fontSize
{
UIFont *font = [UIFont fontWithName:@"PingFangSC-Light" size:fontSize];
if (!font) {
font = [UIFont systemFontOfSize:fontSize];
}
return font;
}
+ (UIFont *)fontOfBoldWithSize:(CGFloat)fontSize
{
UIFont *font = [UIFont fontWithName:@"PingFangSC-Bold" size:fontSize];
if (!font) {
font = [UIFont boldSystemFontOfSize:fontSize];
}
return font;
}
+ (UIFont *)fontOfSCWithSize:(CGFloat)fontSize
{
UIFont *font = [UIFont fontWithName:@"PingFangSC" size:fontSize];
if (!font) {
font = [UIFont systemFontOfSize:fontSize];
}
return font;
}
@end