41 lines
985 B
Objective-C
Executable File
41 lines
985 B
Objective-C
Executable File
//
|
|
// BJConst.m
|
|
// MoHuanXingYu
|
|
//
|
|
// Created by ybb on 2021/4/14.
|
|
// Copyright © 2021 MoHuanXingYu. All rights reserved.
|
|
//
|
|
|
|
#import "BJConst.h"
|
|
|
|
@implementation BJConst
|
|
|
|
#pragma mark - 字体
|
|
UIFont *YBFont(NSInteger size) {
|
|
return [UIFont systemFontOfSize:size];
|
|
}
|
|
UIFont *YBBoldFont(NSInteger size) {
|
|
return [UIFont boldSystemFontOfSize:size];
|
|
}
|
|
UIFont *YBMediumFont(NSInteger size) {
|
|
return [UIFont systemFontOfSize:size weight:UIFontWeightMedium];
|
|
}
|
|
UIFont *YBSystemFont(NSInteger size) {
|
|
return [UIFont systemFontOfSize:size];
|
|
}
|
|
UIFont *YBBoldSystemFont(NSInteger size) {
|
|
return [UIFont boldSystemFontOfSize:size];
|
|
}
|
|
|
|
|
|
CGFloat YBFontW(UIFont *font,NSString *str) {
|
|
return floor([str boundingRectWithSize:CGSizeMake(MAXFLOAT, font.lineHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size.width+1);
|
|
}
|
|
|
|
|
|
UIWindow * MainWindow(){
|
|
return [UIApplication sharedApplication].keyWindow;
|
|
}
|
|
|
|
@end
|