Commit 3c6bf45e cgx

搭建首页舒眠课程、助眠音乐 UI、调试图片黑夜模式等

1 个父辈 cba9571e
正在显示 41 个修改的文件 包含 712 行增加52 行删除
//
// UIButton+Extras.h
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, UIButtonLayoutType) {
UIButtonLayoutTypeLeftTitleRightImage = 0,
UIButtonLayoutTypeUpImageBottomTitle = 1
};
NS_ASSUME_NONNULL_BEGIN
@interface UIButton (Extras)
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor imgName:(NSString *)imgName font:(UIFont *)font;
/// 创建 UIButton
/// @param subTitle 二级 title
/// @param imgName 图片名
/// @param font 字体
+ (instancetype)dkBtnWithSubTitle:(NSString *)subTitle imgName:(NSString *)imgName font:(UIFont *)font;
/**
* 按钮中图片和标题布局方式(上下及左右)
*
* @param type 按钮布局类型
* @param midSpace 图片和标题间距
* @param sizeToFit 是否按尺寸调整
*/
- (void)adjustLayoutWithType:(UIButtonLayoutType)type midSpace:(CGFloat)midSpace sizeToFit:(BOOL)sizeToFit;
@end
NS_ASSUME_NONNULL_END
//
// UIButton+Extras.m
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import "UIButton+Extras.h"
@implementation UIButton (Extras)
+ (instancetype)btnWithTitle:(NSString *)title titleColor:(UIColor *)titleColor imgName:(NSString *)imgName font:(UIFont *)font {
UIButton *btn = [UIButton new];
[btn setTitle:title forState:UIControlStateNormal];
[btn setTitleColor:titleColor forState:UIControlStateNormal];
[btn setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
[btn.titleLabel setFont:font];
return btn;
}
+ (instancetype)dkBtnWithSubTitle:(NSString *)subTitle imgName:(NSString *)imgName font:(UIFont *)font {
UIButton *btn = [UIButton new];
[btn setTitle:subTitle forState:UIControlStateNormal];
[btn dk_setTitleColorPicker:DKColorPickerWithKey(SubTEXT) forState:UIControlStateNormal];
[btn setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
[btn.titleLabel setFont:font];
return btn;
}
- (void)adjustLayoutWithType:(UIButtonLayoutType)type midSpace:(CGFloat)midSpace sizeToFit:(BOOL)sizeToFit
{
if (sizeToFit) {
[self sizeToFit];
if (UIButtonLayoutTypeLeftTitleRightImage == type) {
self.width += midSpace;
}
}
CGSize titleSize;
titleSize = [[self titleForState:UIControlStateNormal] sizeWithAttributes:@{NSFontAttributeName:self.titleLabel.font}];
UIEdgeInsets titleEdgeInset = UIEdgeInsetsZero;
UIEdgeInsets imageEdgeInset = UIEdgeInsetsZero;
CGSize imageSize = self.imageView.frame.size;
if (UIButtonLayoutTypeLeftTitleRightImage == type) {
titleEdgeInset = UIEdgeInsetsMake(0, -imageSize.width, 0, self.imageView.width + midSpace);
imageEdgeInset = UIEdgeInsetsMake(0, titleSize.width + midSpace, 0, -titleSize.width);
} else if (UIButtonLayoutTypeUpImageBottomTitle == type) {
titleEdgeInset = UIEdgeInsetsMake(imageSize.height + midSpace, -imageSize.width, 0, 0);
imageEdgeInset = UIEdgeInsetsMake(-(titleSize.height + midSpace), 0, 0, -titleSize.width);
}
[self setTitleEdgeInsets:titleEdgeInset];
[self setImageEdgeInsets:imageEdgeInset];
}
@end
//
// UILabel+Extras.h
// DreamSleep
//
// Created by peter on 2022/4/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UILabel (Extras)
#pragma mark - Create
// 白天和黑夜模式下的UILabel
+ (UILabel *)dkLabWithText:(NSString *)text font:(UIFont *)font;
+ (UILabel *)dkLabWithFont:(UIFont *)font;
+ (UILabel *)labWithTextColor:(UIColor *)textColor font:(UIFont *)font;
@end
NS_ASSUME_NONNULL_END
//
// UILabel+Extras.m
// DreamSleep
//
// Created by peter on 2022/4/11.
//
#import "UILabel+Extras.h"
@implementation UILabel (Extras)
#pragma mark - Create
+ (UILabel *)dkLabWithText:(NSString *)text font:(UIFont *)font {
UILabel *lab = [UILabel new];
lab.text = text;
lab.font = font;
lab.dk_textColorPicker = DKColorPickerWithKey(TEXT);
[lab sizeToFit];
return lab;
}
+ (UILabel *)dkLabWithFont:(UIFont *)font {
UILabel *lab = [UILabel new];
lab.font = font;
lab.dk_textColorPicker = DKColorPickerWithKey(TEXT);
return lab;
}
+ (UILabel *)labWithTextColor:(UIColor *)textColor font:(UIFont *)font {
UILabel *lab = [UILabel new];
lab.font = font;
lab.textColor = textColor;
return lab;
}
@end
......@@ -21,20 +21,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
// 导航栏背景色
// self.navigationController.navigationBar.dk_barTintColorPicker = DKColorPickerWithKey(NaviBG);
// leftItem
UILabel *leftLab = [[UILabel alloc] init];
leftLab.text = @"小梦睡眠";
leftLab.dk_textColorPicker = DKColorPickerWithKey(TEXT);
leftLab.font = [UIFont boldSystemFontOfSize:24.0];
[leftLab sizeToFit];
UILabel *leftLab = [UILabel dkLabWithText:@"小梦睡眠" font:BoldFont(24.0)];
UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:leftLab];
self.navigationItem.leftBarButtonItem = leftItem;
// view背景色
// self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
}
#pragma mark - 导航栏日间模式
......
//
// SafeSleepModel.h
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 舒眠课程、助眠音乐、好眠声音数据 model
@interface SafeSleepModel : NSObject
@property (nonatomic, copy) NSString *title;
+ (NSArray *)getDatas;
@end
NS_ASSUME_NONNULL_END
//
// SafeSleepModel.m
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import "SafeSleepModel.h"
@implementation SafeSleepModel
+ (NSArray *)getDatas {
NSArray *titles = @[@"舒眠课程", @"助眠音乐", @"好眠声音"];
NSMutableArray *tmpDatas = [NSMutableArray array];
for (int i = 0; i < 3; i++) {
SafeSleepModel *m = [SafeSleepModel new];
m.title = titles[i];
[tmpDatas addObject:m];
}
return [tmpDatas copy];
}
@end
......@@ -7,8 +7,8 @@
#import "HomeTableView.h"
#import "DSGifHeader.h"
#import "HomeTableViewCell.h"
#import "HomeHeaderView.h"
#import "SafeSleepCell.h"
@interface HomeTableView () <UITableViewDelegate>
@property (nonatomic, strong) HomeHeaderView *headerView;
......@@ -20,7 +20,9 @@
- (instancetype)initDemo {
if (self = [super initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight) style:UITableViewStylePlain]) {
self.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[self.homeDataSource addDataArray:@[@1, @2, @3]];
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.showsVerticalScrollIndicator = NO;
[self.homeDataSource addDataArray:[SafeSleepModel getDatas]];
self.mj_header = [DSGifHeader headerWithRefreshingBlock:^{
dispatch_after(5.0, dispatch_get_main_queue(), ^{
[self.mj_header endRefreshing];
......@@ -32,17 +34,14 @@
- (DSDataSource *)homeDataSource {
if (!_homeDataSource) {
CellConfigureBlock cellBlock = ^(HomeTableViewCell * cell, id model, NSIndexPath * indexPath) {
cell.textLabel.text = @"chengx";
cell.backgroundColor = BrandColor;
// [cell configureCell:model];
CellConfigureBlock cellBlock = ^(SafeSleepCell * cell, SafeSleepModel * model, NSIndexPath * indexPath) {
[cell configureCellWithModel:model indexPath:indexPath];
};
NSString * const homeCellIdentifier = @"HomeCellIdentifier";
_homeDataSource = [[DSDataSource alloc] initWithIdentifier:homeCellIdentifier datas:@[] isSection:NO configureBlock:cellBlock];
NSString * const safeSleepCellID = @"safeSleepCellID";
_homeDataSource = [[DSDataSource alloc] initWithIdentifier:safeSleepCellID datas:@[] isSection:NO configureBlock:cellBlock];
self.dataSource = _homeDataSource;
self.delegate = self;
[self registerClass:[HomeTableViewCell class] forCellReuseIdentifier:homeCellIdentifier];
[self registerClass:[SafeSleepCell class] forCellReuseIdentifier:safeSleepCellID];
self.tableHeaderView = self.headerView;
}
return _homeDataSource;
......@@ -56,14 +55,20 @@
CGFloat width = (kScreenWidth - 2*15 - 14)/2;
CGFloat height = 15 + bannerH + 24 + 133*width/165.0;
_headerView = [[HomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, height)];
_headerView.backgroundColor = self.backgroundColor;
_headerView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
}
return _headerView;
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 70;
CGFloat height = 300;
if (indexPath.row == 0) {
height = 206;
} else if (indexPath.row == 1) {
height = 196;
}
return height;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
......
//
// HomeTableViewCell.m
// DreamSleep
//
// Created by peter on 2022/4/8.
//
#import "HomeTableViewCell.h"
@implementation HomeTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// SafeHelperCollectionView.h
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 舒眠课程、助眠音乐集合视图
@interface SafeHelperCollectionView : UICollectionView
- (instancetype)initCollectionViewWithIndexPath:(NSIndexPath *)indexPath;
@end
NS_ASSUME_NONNULL_END
//
// SafeHelperCollectionView.m
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import "SafeHelperCollectionView.h"
#import "SafeHelperCollectionViewCell.h"
@interface SafeHelperCollectionView () <UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) NSIndexPath *cellIndexPath;
@end
@implementation SafeHelperCollectionView
- (instancetype)initCollectionViewWithIndexPath:(NSIndexPath *)indexPath {
self.cellIndexPath = indexPath;
CGFloat width = indexPath.row == 0 ? 100 : 90;
CGFloat height = indexPath.row == 0 ? 130 : 120;
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 10);
layout.itemSize = CGSizeMake(width, height);
layout.minimumLineSpacing = 12;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
if (self = [super initWithFrame:CGRectMake(0, 0, 0, height) collectionViewLayout:layout]) {
[self registerClass:[SafeHelperCollectionViewCell class] forCellWithReuseIdentifier:@"shCollectionViewCell"];
self.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.showsHorizontalScrollIndicator = NO;
self.delegate = self;
self.dataSource = self;
}
return self;
}
#pragma mark - UICollectionViewDelegate && UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 8;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SafeHelperCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"shCollectionViewCell" forIndexPath:indexPath];
[cell mockDatas:self.cellIndexPath];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"row:%ld", indexPath.row);
}
@end
//
// HomeTableViewCell.h
// SafeHelperCollectionViewCell.h
// DreamSleep
//
// Created by peter on 2022/4/8.
// Created by peter on 2022/4/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeTableViewCell : UITableViewCell
@interface SafeHelperCollectionViewCell : UICollectionViewCell
- (void)mockDatas:(NSIndexPath *)cellIndexPath;
@end
......
//
// SafeHelperCollectionViewCell.m
// DreamSleep
//
// Created by peter on 2022/4/12.
//
#import "SafeHelperCollectionViewCell.h"
@interface SafeHelperCollectionViewCell ()
// 圆角视图(舒眠课程Cell显示)
@property (nonatomic, strong) UIView *roundedView;
// 主圆角图片
@property (nonatomic, strong) UIImageView *homeIV;
// 舒眠课程icon
@property (nonatomic, strong) UIImageView *courseIcon;
// 舒眠课时标签
@property (nonatomic, strong) UILabel *courseLab;
// 音乐类型
@property (nonatomic, strong) UILabel *audioTypeLab;
@end
@implementation SafeHelperCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self addSubview:self.homeIV];
[self addSubview:self.audioTypeLab];
}
return self;
}
- (void)mockDatas:(NSIndexPath *)cellIndexPath {
self.homeIV.image = [UIImage imageNamed:cellIndexPath.row == 0 ? @"test0" : @"test1"];
self.audioTypeLab.text = @"都会浪漫";
[self.audioTypeLab sizeToFit];
if (cellIndexPath.row == 0) { // 舒眠课程
[self insertSubview:self.roundedView belowSubview:self.homeIV];
[self addSubview:self.courseIcon];
[self addSubview:self.courseLab];
self.courseLab.text = @"10课时";
[self.courseLab sizeToFit];
[self.roundedView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self);
make.width.equalTo(@(100 - 2*12));
make.height.equalTo(@20);
make.centerX.equalTo(self.homeIV);
}];
[self.courseIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.homeIV).offset(7);
make.bottom.equalTo(self.homeIV).offset(-3);
}];
[self.courseLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.courseIcon.mas_right).offset(2);
make.centerY.equalTo(self.courseIcon);
}];
}
CGFloat width = cellIndexPath.row == 0 ? 100 : 90;
CGFloat bottomSpace = cellIndexPath.row == 0 ? 0 : -3;
CGFloat topSpacing = cellIndexPath.row == 0 ? 4 : 0;
[self.homeIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).offset(topSpacing);
make.left.equalTo(self);
make.width.height.equalTo(@(width));
}];
[self.audioTypeLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.homeIV);
make.bottom.equalTo(self).offset(bottomSpace);
}];
}
- (UIView *)roundedView {
if (!_roundedView) {
_roundedView = [UIView new];
_roundedView.backgroundColor = ColorFromHex(0xECECEC);
_roundedView.layer.cornerRadius = 12;
_roundedView.layer.masksToBounds = YES;
}
return _roundedView;
}
- (UIImageView *)homeIV {
if (!_homeIV) {
_homeIV = [UIImageView new];
_homeIV.contentMode = UIViewContentModeScaleAspectFill;
}
return _homeIV;
}
- (UIImageView *)courseIcon {
if (!_courseIcon) {
_courseIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"courseIcon"]];
[_courseIcon sizeToFit];
}
return _courseIcon;
}
- (UILabel *)courseLab {
if (!_courseLab) {
_courseLab = [UILabel labWithTextColor:DSWhite font:SysFont(10)];
}
return _courseLab;
}
- (UILabel *)audioTypeLab {
if (!_audioTypeLab) {
_audioTypeLab = [UILabel dkLabWithFont:SysFont(15)];
}
return _audioTypeLab;
}
@end
//
// SafeSleepCell.h
// DreamSleep
//
// Created by peter on 2022/4/11.
//
#import <UIKit/UIKit.h>
#import "SafeSleepModel.h"
NS_ASSUME_NONNULL_BEGIN
/// 舒眠课程、助眠音乐、好眠声音静态Cell
@interface SafeSleepCell : UITableViewCell
@property (nonatomic, strong) SafeSleepModel *model;
@property (nonatomic, strong) NSIndexPath *indexPath;
- (void)configureCellWithModel:(SafeSleepModel *)model indexPath:(NSIndexPath *)indexPath;
@end
NS_ASSUME_NONNULL_END
//
// SafeSleepCell.m
// DreamSleep
//
// Created by peter on 2022/4/11.
//
#import "SafeSleepCell.h"
#import "SafeHelperCollectionView.h"
#import "SafeHelperCollectionViewCell.h"
@interface SafeSleepCell ()
@property (nonatomic, strong) UIView *leftIV;
@property (nonatomic, strong) UILabel *recommandLb;
@property (nonatomic, strong) UIButton *moreBtn;
@property (nonatomic, strong) UIButton *timerBtn;
@property (nonatomic, strong) SafeHelperCollectionView *shCollectionView;
@end
@implementation SafeSleepCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.contentView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[self.contentView addSubview:self.leftIV];
[self.contentView addSubview:self.recommandLb];
}
return self;
}
// 隐藏选中Cell时的分割线
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
self.selectedBackgroundView = [[UIView alloc] initWithFrame:self.frame];
self.selectedBackgroundView.backgroundColor = DSClearColor;
[super setSelected:selected animated:animated];
}
- (void)configureCellWithModel:(SafeSleepModel *)model indexPath:(NSIndexPath *)indexPath {
_model = model;
_indexPath = indexPath;
self.recommandLb.text = model.title;
[self.leftIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(10);
make.top.equalTo(self.contentView.mas_top).offset(33);
make.width.equalTo(@4);
make.height.equalTo(@16);
}];
[self.recommandLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.leftIV.mas_right).offset(10);
make.centerY.equalTo(self.leftIV.mas_centerY);
}];
if (indexPath.row == 2) { // 好眠声音区域
[self.contentView addSubview:self.timerBtn];
[self.timerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-5);
make.width.equalTo(@100);
make.height.equalTo(@30);
make.centerY.equalTo(self.leftIV.mas_centerY);
}];
} else { // 舒眠课程和助眠音乐
[self.contentView addSubview:self.moreBtn];
[self.contentView addSubview:self.shCollectionView];
[self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-5);
make.width.equalTo(@100);
make.height.equalTo(@30);
make.centerY.equalTo(self.leftIV.mas_centerY);
}];
[self.shCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.recommandLb.mas_bottom).offset(17);
make.left.equalTo(self.leftIV);
make.right.equalTo(self.contentView);
make.bottom.equalTo(self.contentView).offset(0);
}];
}
}
- (UIView *)leftIV {
if (!_leftIV) {
_leftIV = [UIView new];
_leftIV.backgroundColor = BrandColor;
_leftIV.layer.cornerRadius = 3;
_leftIV.layer.masksToBounds = YES;
}
return _leftIV;
}
- (UILabel *)recommandLb {
if (!_recommandLb) {
_recommandLb = [UILabel dkLabWithText:@"助眠音乐" font:BoldFont(16.0)];
}
return _recommandLb;
}
- (UIButton *)moreBtn {
if (!_moreBtn) {
_moreBtn = [UIButton dkBtnWithSubTitle:@"查看全部" imgName:@"rightRow" font:SysFont(12)];
_moreBtn.frame = CGRectMake(0, 0, 100, 40);
[_moreBtn adjustLayoutWithType:UIButtonLayoutTypeLeftTitleRightImage midSpace:4 sizeToFit:NO];
[_moreBtn addTarget:self action:@selector(lookMore:) forControlEvents:UIControlEventTouchUpInside];
}
return _moreBtn;
}
- (UIButton *)timerBtn {
if (!_timerBtn) {
_timerBtn = [UIButton new];
[_timerBtn dk_setImage:DKImagePickerWithNames(@"timerIcon", @"timerIcon_dk") forState:UIControlStateNormal];
[_timerBtn addTarget:self action:@selector(timerSetting:) forControlEvents:UIControlEventTouchUpInside];
}
return _timerBtn;
}
- (SafeHelperCollectionView *)shCollectionView {
if (!_shCollectionView) {
_shCollectionView = [[SafeHelperCollectionView alloc] initCollectionViewWithIndexPath:self.indexPath];
}
return _shCollectionView;
}
#pragma mark - Actions
- (void)timerSetting:(UIButton *)sender {
DSLog(@"timerSetting");
}
- (void)lookMore:(UIButton *)sender {
DSLog(@"cellIndexPath:%ld", self.indexPath.row);
}
@end
......@@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN
/// 下拉Gif刷新控件
@interface DSGifHeader : MJRefreshGifHeader
@end
NS_ASSUME_NONNULL_END
......@@ -31,9 +31,9 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// 模拟切换黑夜模式
if ([self.dk_manager.themeVersion isEqualToString:DKThemeVersionNight]) {
[self.dk_manager dawnComing];
self.dk_manager.themeVersion = DKThemeVersionNormal;
} else {
[self.dk_manager nightFalling];
self.dk_manager.themeVersion = DKThemeVersionNight;
}
}
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "courseIcon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "courseIcon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "courseIcon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "rightRow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "rightRow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "test0.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "test1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "timerIcon_dk.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "timerIcon_dk@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "timerIcon_dk@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "timerIcon_dk.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "timerIcon_dk@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "timerIcon_dk@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -11,5 +11,6 @@ NORMAL NIGHT RED
#FFFFFF #161E38 #FAF5F5 NaviBG
#333333 #FFFFFF #000000 TEXT
#AAAAAA #FFFFFF #000000 SubTEXT
......@@ -68,6 +68,12 @@
/** 紧急提示文案颜色 */
#define UrgencyColor [UIColor colorWithHexString:@"#FD5E5E"]
#pragma mark - 字体
/** 常规适配 */
#define SysFont(size) [UIFont systemFontOfSize:size]
/** 粗体适配 */
#define BoldFont(size) [UIFont boldSystemFontOfSize:size]
NS_ASSUME_NONNULL_BEGIN
@interface AdaptationUtil : NSObject
// 获取keyWindow(在iOS 13.5真机存在bug?)
......
......@@ -19,6 +19,8 @@
#import <Masonry/Masonry.h>
#import "UIView+Extras.h"
#import "UILabel+Extras.h"
#import "UIButton+Extras.h"
#import "NaviBarHandlerProtocol.h"
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!