Commit c572879d cgx

完成版本更新弹框

1 个父辈 45226fe0
正在显示 26 个修改的文件 包含 370 行增加7 行删除
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C499284F4F0D000F3089 /* DailyTaskCell.m */; }; D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C499284F4F0D000F3089 /* DailyTaskCell.m */; };
D037C49D284F5DE8000F3089 /* DailyTaskSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* DailyTaskSrollView.m */; }; D037C49D284F5DE8000F3089 /* DailyTaskSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* DailyTaskSrollView.m */; };
D03AE82B281A9010001C0726 /* MyFeedDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */; }; D03AE82B281A9010001C0726 /* MyFeedDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */; };
D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; };
D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD57285B25EE0043A4CE /* VersionRequestModel.m */; };
D0496798283484CC00FB81E5 /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0496797283484CC00FB81E5 /* ProfileTableView.m */; }; D0496798283484CC00FB81E5 /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0496797283484CC00FB81E5 /* ProfileTableView.m */; };
D049679D2834E1AB00FB81E5 /* ProfileHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = D049679C2834E1AB00FB81E5 /* ProfileHeaderView.m */; }; D049679D2834E1AB00FB81E5 /* ProfileHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = D049679C2834E1AB00FB81E5 /* ProfileHeaderView.m */; };
D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */ = {isa = PBXBuildFile; fileRef = D04B3D9827F6D4D90022F8DF /* LeadingController.m */; }; D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */ = {isa = PBXBuildFile; fileRef = D04B3D9827F6D4D90022F8DF /* LeadingController.m */; };
...@@ -322,6 +324,10 @@ ...@@ -322,6 +324,10 @@
D03ABDAF28328F4300DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UnityFramework.framework; path = "TapiOS/build/Release-iphoneos/UnityFramework.framework"; sourceTree = "<group>"; }; D03ABDAF28328F4300DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UnityFramework.framework; path = "TapiOS/build/Release-iphoneos/UnityFramework.framework"; sourceTree = "<group>"; };
D03AE829281A9010001C0726 /* MyFeedDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFeedDetailModel.h; sourceTree = "<group>"; }; D03AE829281A9010001C0726 /* MyFeedDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFeedDetailModel.h; sourceTree = "<group>"; };
D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFeedDetailModel.m; sourceTree = "<group>"; }; D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFeedDetailModel.m; sourceTree = "<group>"; };
D043DD53285B11860043A4CE /* VersionUpdateBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionUpdateBox.h; sourceTree = "<group>"; };
D043DD54285B11860043A4CE /* VersionUpdateBox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VersionUpdateBox.m; sourceTree = "<group>"; };
D043DD56285B25EE0043A4CE /* VersionRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionRequestModel.h; sourceTree = "<group>"; };
D043DD57285B25EE0043A4CE /* VersionRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VersionRequestModel.m; sourceTree = "<group>"; };
D0496796283484CC00FB81E5 /* ProfileTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; }; D0496796283484CC00FB81E5 /* ProfileTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; };
D0496797283484CC00FB81E5 /* ProfileTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; }; D0496797283484CC00FB81E5 /* ProfileTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; };
D049679B2834E1AB00FB81E5 /* ProfileHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProfileHeaderView.h; sourceTree = "<group>"; }; D049679B2834E1AB00FB81E5 /* ProfileHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProfileHeaderView.h; sourceTree = "<group>"; };
...@@ -911,6 +917,17 @@ ...@@ -911,6 +917,17 @@
path = Category; path = Category;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
D043DD52285B101A0043A4CE /* AppUpdate */ = {
isa = PBXGroup;
children = (
D043DD53285B11860043A4CE /* VersionUpdateBox.h */,
D043DD54285B11860043A4CE /* VersionUpdateBox.m */,
D043DD56285B25EE0043A4CE /* VersionRequestModel.h */,
D043DD57285B25EE0043A4CE /* VersionRequestModel.m */,
);
path = AppUpdate;
sourceTree = "<group>";
};
D04567A827F6D018009F0A82 /* Resource */ = { D04567A827F6D018009F0A82 /* Resource */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -947,6 +964,7 @@ ...@@ -947,6 +964,7 @@
children = ( children = (
D0FAC666281BB91700D4B859 /* Root */, D0FAC666281BB91700D4B859 /* Root */,
D04567A927F6D038009F0A82 /* Launcher */, D04567A927F6D038009F0A82 /* Launcher */,
D043DD52285B101A0043A4CE /* AppUpdate */,
D0C50B4327FD3DE800DC68F0 /* PrivacyPolicy */, D0C50B4327FD3DE800DC68F0 /* PrivacyPolicy */,
); );
path = Start; path = Start;
...@@ -1927,6 +1945,7 @@ ...@@ -1927,6 +1945,7 @@
files = ( files = (
D037C49D284F5DE8000F3089 /* DailyTaskSrollView.m in Sources */, D037C49D284F5DE8000F3089 /* DailyTaskSrollView.m in Sources */,
D09D0E9D280D73B6008DEDAB /* InviteController.m in Sources */, D09D0E9D280D73B6008DEDAB /* InviteController.m in Sources */,
D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */,
D0534F092835D90400F8892E /* DSNaviBarViewController.m in Sources */, D0534F092835D90400F8892E /* DSNaviBarViewController.m in Sources */,
D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */, D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */,
D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */, D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */,
...@@ -2091,6 +2110,7 @@ ...@@ -2091,6 +2110,7 @@
D01814E8280020F900583D4E /* CWPageControl.m in Sources */, D01814E8280020F900583D4E /* CWPageControl.m in Sources */,
D027EE3027FB52DA004BBA61 /* UIImage+Extras.m in Sources */, D027EE3027FB52DA004BBA61 /* UIImage+Extras.m in Sources */,
D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */, D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */,
D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */,
D0A7510E282E2FEF00589B0E /* NoisePlayView.m in Sources */, D0A7510E282E2FEF00589B0E /* NoisePlayView.m in Sources */,
D08F79DD281A1838000D99DD /* TZImageManager.m in Sources */, D08F79DD281A1838000D99DD /* TZImageManager.m in Sources */,
D0E41B602851E0F6005A7DA4 /* ShareItem.m in Sources */, D0E41B602851E0F6005A7DA4 /* ShareItem.m in Sources */,
......
...@@ -41,7 +41,7 @@ NSString * const QQAppID = @"1111310949"; ...@@ -41,7 +41,7 @@ NSString * const QQAppID = @"1111310949";
NSString * const QQAppKey = @"CiiSZ3E04SlKKmVN"; NSString * const QQAppKey = @"CiiSZ3E04SlKKmVN";
NSString * const UMengAppKey = @"62048053e0f9bb492bfcb0e8"; NSString * const UMengAppKey = @"62048053e0f9bb492bfcb0e8";
NSString * const AppSotreID = @"id1609336070"; NSString * const AppSotreID = @"1609336070";
@implementation DSConstUtil @implementation DSConstUtil
@end @end
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
return YES; return YES;
} }
#pragma mark - 设置状态栏文字颜色 #pragma mark - 隐藏状态栏
- (BOOL)prefersStatusBarHidden { - (BOOL)prefersStatusBarHidden {
return YES; return YES;
} }
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
@implementation SetModel @implementation SetModel
+ (NSArray *)getAllSetDatas { + (NSArray *)getAllSetDatas {
NSArray *titles = @[@"应用版本及升级", @"用户协议", @"隐私政策", @"清除缓存"]; NSArray *titles = @[@"给我评分", @"用户协议", @"隐私政策", @"清除缓存"];
NSString *version = [NSString stringWithFormat:@"当前版本%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]]; NSString *version = [NSString stringWithFormat:@"V %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];
NSString *cacheSize = [DsCacheUtils getCacheSize]; NSString *cacheSize = [DsCacheUtils getCacheSize];
NSArray *details = @[version, @"", @"", cacheSize]; NSArray *details = @[version, @"", @"", cacheSize];
NSMutableArray *tmpArr = [NSMutableArray array]; NSMutableArray *tmpArr = [NSMutableArray array];
...@@ -239,8 +239,9 @@ ...@@ -239,8 +239,9 @@
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) { // 应用版本升级 if (indexPath.row == 0) { // 给我评分
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/%@", AppSotreID]]; NSString *evaluateStr = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review", AppSotreID];
NSURL *url = [NSURL URLWithString:evaluateStr];
if ([[UIApplication sharedApplication] canOpenURL:url]) { if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
} }
......
//
// VersionRequestModel.h
// DreamSleep
//
// Created by peter on 2022/6/16.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
@interface VersionRequestModel : DSNetworkTool
/// 0:强制更新 1:用户选择更新
@property (nonatomic, assign) int update_Way;
+ (NSURLSessionDataTask *)queryAppVersionRequestWithCompletion:(void (^)(VersionRequestModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
//
// VersionRequestModel.m
// DreamSleep
//
// Created by peter on 2022/6/16.
//
#import "VersionRequestModel.h"
@implementation VersionRequestModel
+ (NSURLSessionDataTask *)queryAppVersionRequestWithCompletion:(void (^)(VersionRequestModel *requestModel))completion {
VersionRequestModel * requestModel = [[VersionRequestModel alloc] init];
NSString *api = @"query_app_version";
NSString *argStr = [NSString stringWithFormat:@"query{%@(sys_code:\"IOS\",version_code:\"stable\")}", api];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"App版本升级接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
NSDictionary *resultDic = apiDic[@"result"];
requestModel.update_Way = [resultDic[@"Update_Way"] intValue];
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = DSResCodeNetFail;
requestModel.errorInfo = failureInfo;
completion(requestModel);
}];
}
@end
//
// VersionUpdateBox.h
// DreamSleep
//
// Created by peter on 2022/6/16.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 版本更新弹框
@interface VersionUpdateBox : UIView
/// 显示版本更新弹框
/// @param isForce 是否强制更新
- (void)showVersionUpdate:(BOOL)isForce;
@end
NS_ASSUME_NONNULL_END
//
// VersionUpdateBox.m
// DreamSleep
//
// Created by peter on 2022/6/16.
//
#import "VersionUpdateBox.h"
@interface VersionUpdateBox ()
@property (nonatomic, strong) UIImageView *updateBox;
@property (nonatomic, strong) UIButton *closeBtn;
@end
@implementation VersionUpdateBox
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
self.backgroundColor = DarkColor;
self.backgroundColor = [self.backgroundColor colorWithAlphaComponent:0.6];
[self addSubview:self.updateBox];
[self.updateBox mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.size.mas_equalTo(CGSizeMake(280, 397));
}];
}
return self;
}
#pragma mark - public
- (void)showVersionUpdate:(BOOL)isForce {
[DSKeyWindow addSubview:self];
self.closeBtn.hidden = isForce;
}
- (void)dismiss {
[self removeFromSuperview];
}
#pragma mark - Action
- (void)closeAction {
[self dismiss];
}
- (void)updateApp {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", AppSotreID]];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
}
#pragma mark - lazy
- (UIImageView *)updateBox {
if (!_updateBox) {
_updateBox = [[UIImageView alloc] dk_initWithImagePicker:DKImagePickerWithNames(@"version_update", @"dk_version_update", @"version_update")];
_updateBox.userInteractionEnabled = YES;
[_updateBox addSubview:self.closeBtn];
UILabel *versionLab = [UILabel labWithText:[NSString stringWithFormat:@"V%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]] font:SysFont(10.0) fit:YES];
versionLab.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, ColorFromHex(0xAEB1BA), DSWhite);
versionLab.dk_textColorPicker = DKColorPickerWithColors(BrandColor, ColorFromHex(0x47899E), DSWhite);
versionLab.textAlignment = NSTextAlignmentCenter;
[versionLab cornerRadius:7.0];
[_updateBox addSubview:versionLab];
UILabel *lab1 = [UILabel labWithText:@"1.全新设计,全新体验;" textColor:SubTitleColor font:SysFont(14.0)];
[_updateBox addSubview:lab1];
UILabel *lab2 = [UILabel labWithText:@"2.人机交互哄睡,助你快速入睡;" textColor:SubTitleColor font:SysFont(14.0)];
[_updateBox addSubview:lab2];
UILabel *lab3 = [UILabel labWithText:@"3.提升系统稳定性;" textColor:SubTitleColor font:SysFont(14.0)];
[_updateBox addSubview:lab3];
UIButton *updateBtn = [UIButton btnWithTitle:@"立即升级" font:BoldFont(16.0)];
[updateBtn addTarget:self action:@selector(updateApp) forControlEvents:UIControlEventTouchUpInside];
[updateBtn cornerRadius:22.0];
[updateBtn dk_setTitleColorPicker:DKColorPickerWithColors(DSWhite, ColorFromHex(0xAEB1BA), DSWhite) forState:UIControlStateNormal];
updateBtn.dk_backgroundColorPicker = DKColorPickerWithColors(BrandColor, ColorFromHex(0x47899E), DSWhite);
[_updateBox addSubview:updateBtn];
UILabel *wifiLab = [UILabel labWithText:@"wifi环境下更新不到30秒哦~" textColor:SubTitleColor font:SysFont(12.0)];
wifiLab.textAlignment = NSTextAlignmentCenter;
[_updateBox addSubview:wifiLab];
[versionLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_updateBox).offset(94);
make.left.equalTo(_updateBox).offset(112);
make.size.mas_equalTo(CGSizeMake(versionLab.width + 8, versionLab.height + 4));
}];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_updateBox).offset(36);
make.right.equalTo(_updateBox);
}];
[lab1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(_updateBox).offset(35);
make.top.equalTo(_updateBox).offset(228);
}];
[lab2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(lab1);
make.top.equalTo(lab1.mas_bottom).offset(6);
}];
[lab3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(lab1);
make.top.equalTo(lab2.mas_bottom).offset(6);
}];
[updateBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(_updateBox);
make.top.equalTo(lab3.mas_bottom).offset(17);
make.size.mas_equalTo(CGSizeMake(210, 40));
}];
[wifiLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(_updateBox);
make.top.equalTo(updateBtn.mas_bottom).offset(8);
}];
}
return _updateBox;
}
- (UIButton *)closeBtn {
if (!_closeBtn) {
_closeBtn = [UIButton new];
[_closeBtn dk_setImage:DKImagePickerWithNames(@"close_update", @"dk_close_update", @"close_update") forState:UIControlStateNormal];
[_closeBtn addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
}
return _closeBtn;
}
@end
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
// //
#import "DSTabBarController.h" #import "DSTabBarController.h"
#import "VersionUpdateBox.h"
#import "VersionRequestModel.h"
@interface DSTabBarController () @interface DSTabBarController ()
// 记录上一次点击tabbar // 记录上一次点击tabbar
@property (nonatomic, assign) NSInteger indexFlag; @property (nonatomic, assign) NSInteger indexFlag;
@property (nonatomic, strong) VersionUpdateBox *updateBox;
@end @end
@implementation DSTabBarController @implementation DSTabBarController
...@@ -17,6 +20,40 @@ ...@@ -17,6 +20,40 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateVersionAction) name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void)updateVersionAction {
// [VersionRequestModel queryAppVersionRequestWithCompletion:^(VersionRequestModel * _Nonnull requestModel) {
//
// }];
NSString *url = [NSString stringWithFormat:@"http://itunes.apple.com/cn/lookup?id=%@", AppSotreID];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/javascript", nil];
[manager POST:url parameters:nil headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSArray *results = responseObject[@"results"];
if (results.count > 0) {
// 获取版本号
NSString *serverVersion = responseObject[@"results"][0][@"version"];
// 获取当前版本号
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
DSLog(@"serverVersion:%@, appVersion:%@", serverVersion, appVersion);
// 判断本地版本与App Store版本是否一致
if ([appVersion compare:serverVersion options:NSNumericSearch] == NSOrderedAscending) {
[self.updateBox showVersionUpdate:NO];
} else {
[DSProgressHUD showToast:@"当前已是最新版本"];
}
} else {
[DSProgressHUD showToast:@"请去App Store查看是否有更新"];
}
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[DSProgressHUD showToast:@"获取App Store最新版本失败"];
DSLog(@"error:%@", error);
}];
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
...@@ -26,7 +63,7 @@ ...@@ -26,7 +63,7 @@
self.tabBar.backgroundImage = [UIImage new]; self.tabBar.backgroundImage = [UIImage new];
self.tabBar.shadowImage = [UIImage new]; self.tabBar.shadowImage = [UIImage new];
self.tabBar.dk_backgroundColorPicker = DKColorPickerWithKey(TabBarBG); self.tabBar.dk_backgroundColorPicker = DKColorPickerWithKey(TabBarBG);
// 设置tabbar选中及未选中的文字颜色 // 设置tabbar选中及未选中的文字颜色
self.tabBar.tintColor = BrandColor; self.tabBar.tintColor = BrandColor;
self.tabBar.unselectedItemTintColor = SubTitleColor; self.tabBar.unselectedItemTintColor = SubTitleColor;
...@@ -38,6 +75,10 @@ ...@@ -38,6 +75,10 @@
} }
} }
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
}
#pragma mark - UITabBarDelegate #pragma mark - UITabBarDelegate
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
NSInteger index = [self.tabBar.items indexOfObject:item]; NSInteger index = [self.tabBar.items indexOfObject:item];
...@@ -75,4 +116,12 @@ ...@@ -75,4 +116,12 @@
[[btns[index] layer] addAnimation:animation forKey:nil]; [[btns[index] layer] addAnimation:animation forKey:nil];
} }
#pragma mark - lazy
- (VersionUpdateBox *)updateBox {
if (!_updateBox) {
_updateBox = [[VersionUpdateBox alloc] initWithFrame:CGRectZero];
}
return _updateBox;
}
@end @end
{
"images" : [
{
"filename" : "close_update.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "close_update@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "close_update@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_close_update.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_close_update@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_close_update@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_version_update.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_version_update@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_version_update@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "version_update.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "version_update@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "version_update@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!