提交 1e8ca0fa 编写于 作者: J jackjintai

Merge branch 'master' of https://github.com/didi/DoraemonKit

......@@ -6,6 +6,7 @@
//
#import "DoraemonStatusBarViewController.h"
#import "DoraemonManager.h"
@interface DoraemonStatusBarViewController ()
......@@ -17,14 +18,26 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (BOOL)prefersStatusBarHidden
{
// iOS9.0的系统中,新建的window设置的rootViewController默认没有显示状态栏
#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_9_3
- (BOOL)prefersStatusBarHidden {
return NO;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
#endif
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return DoraemonManager.shareInstance.supportedInterfaceOrientations;
}
/*
#pragma mark - Navigation
......
......@@ -88,17 +88,13 @@
self.backgroundColor = [UIColor clearColor];
self.windowLevel = UIWindowLevelStatusBar + 100.f;
self.layer.masksToBounds = YES;
NSString *version= [UIDevice currentDevice].systemVersion;
if(version.doubleValue >=10.0) {
if (!self.rootViewController) {
self.rootViewController = [[UIViewController alloc] init];
}
}else{
//iOS9.0的系统中,新建的window设置的rootViewController默认没有显示状态栏
if (!self.rootViewController) {
self.rootViewController = [[DoraemonStatusBarViewController alloc] init];
}
// 统一使用 DoraemonStatusBarViewController
// 对系统的版本处理放入 DoraemonStatusBarViewController 类中
if (!self.rootViewController) {
self.rootViewController = [[DoraemonStatusBarViewController alloc] init];
}
[self.rootViewController.view addSubview:self.entryBtn];
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
......
......@@ -9,6 +9,7 @@
#import "DoraemonDefine.h"
#import "UIColor+Doraemon.h"
#import "DoraemonHomeViewController.h"
#import "DoraemonNavigationController.h"
@interface DoraemonHomeWindow()
......@@ -70,7 +71,7 @@
- (void)setRootVc:(UIViewController *)rootVc{
if (rootVc) {
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootVc];
DoraemonNavigationController *nav = [[DoraemonNavigationController alloc] initWithRootViewController:rootVc];
NSDictionary *attributesDic = @{
NSForegroundColorAttributeName:[UIColor blackColor],
NSFontAttributeName:[UIFont systemFontOfSize:18]
......
//
// DoraemonNavigationController.h
// DoraemonKit
//
// Created by Chunhui Sun on 2020/7/14.
// Copyright © 2020 YunXIao. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DoraemonNavigationController : UINavigationController
@end
NS_ASSUME_NONNULL_END
//
// DoraemonNavigationController.m
// DoraemonKit
//
// Created by Chunhui Sun on 2020/7/14.
// Copyright © 2020 YunXIao. All rights reserved.
//
#import "DoraemonNavigationController.h"
#import "DoraemonManager.h"
@interface DoraemonNavigationController ()
@end
@implementation DoraemonNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return DoraemonManager.shareInstance.supportedInterfaceOrientations;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -162,5 +162,8 @@ typedef NS_ENUM(NSUInteger, DoraemonManagerPluginType) {
@property (nonatomic, strong) NSMutableDictionary *keyBlockDic;//保存key和block的关系
/// DoKit 支持的旋转方向
@property (assign, nonatomic) UIInterfaceOrientationMask supportedInterfaceOrientations;
@end
NS_ASSUME_NONNULL_END
......@@ -132,4 +132,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 5f1dcd15ca63a6c44978b50f105166e29d3a9fd4
COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册