Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
18c697e2
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
大约 1 年 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
18c697e2
编写于
8月 27, 2019
作者:
Y
yixiangboy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Alert功能 从toast中抽出来
上级
03e48408
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
80 addition
and
54 deletion
+80
-54
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.h
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.h
+29
-0
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.m
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.m
+36
-0
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.h
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.h
+0
-14
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.m
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.m
+0
-26
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
+1
-0
iOS/DoraemonKit/Src/Core/Plugin/AllTest/DoraemonAllTestViewController.m
...t/Src/Core/Plugin/AllTest/DoraemonAllTestViewController.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/Crash/DoraemonCrashViewController.m
...onKit/Src/Core/Plugin/Crash/DoraemonCrashViewController.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/NSLog/DoraemonNSLogViewController.m
...onKit/Src/Core/Plugin/NSLog/DoraemonNSLogViewController.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/StartTime/DoraemonStartTimeViewController.m
...c/Core/Plugin/StartTime/DoraemonStartTimeViewController.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/SubThreadUICheck/DoraemonSubThreadUICheckViewController.m
...SubThreadUICheck/DoraemonSubThreadUICheckViewController.m
+1
-1
iOS/DoraemonKit/Src/Logger/DoraemonCocoaLumberjackViewController.m
...monKit/Src/Logger/DoraemonCocoaLumberjackViewController.m
+1
-1
iOS/DoraemonKit/Src/MethodUseTime/DoraemonMethodUseTimeViewController.m
...t/Src/MethodUseTime/DoraemonMethodUseTimeViewController.m
+1
-1
iOS/DoraemonKitDemo/Podfile.lock
iOS/DoraemonKitDemo/Podfile.lock
+7
-7
未找到文件。
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.h
0 → 100644
浏览文件 @
18c697e2
//
// DoraemonAlertUtil.h
// AFNetworking
//
// Created by didi on 2019/8/27.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
DoraemonAlertOKActionBlock
)(
void
);
typedef
void
(
^
DoraemonAlertCancleActionBlock
)(
void
);
@interface
DoraemonAlertUtil
:
NSObject
+
(
void
)
handleAlertActionWithVC
:(
UIViewController
*
)
vc
okBlock
:(
DoraemonAlertOKActionBlock
)
okBlock
cancleBlock
:(
DoraemonAlertCancleActionBlock
)
cancleBlock
;
+
(
void
)
handleAlertActionWithVC
:(
UIViewController
*
)
vc
text
:(
NSString
*
)
text
okBlock
:(
DoraemonAlertOKActionBlock
)
okBlock
cancleBlock
:(
DoraemonAlertCancleActionBlock
)
cancleBlock
;
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/CommonUI/Alert/DoraemonAlertUtil.m
0 → 100644
浏览文件 @
18c697e2
//
// DoraemonAlertUtil.m
// AFNetworking
//
// Created by didi on 2019/8/27.
//
#import "DoraemonAlertUtil.h"
#import "Doraemoni18NUtil.h"
@implementation
DoraemonAlertUtil
+
(
void
)
handleAlertActionWithVC
:(
UIViewController
*
)
vc
okBlock
:(
DoraemonAlertOKActionBlock
)
okBlock
cancleBlock
:(
DoraemonAlertCancleActionBlock
)
cancleBlock
{
[
self
handleAlertActionWithVC
:
vc
text
:
DoraemonLocalizedString
(
@"该功能需要重启App才能生效"
)
okBlock
:
okBlock
cancleBlock
:
cancleBlock
];
}
+
(
void
)
handleAlertActionWithVC
:(
UIViewController
*
)
vc
text
:(
NSString
*
)
text
okBlock
:(
DoraemonAlertOKActionBlock
)
okBlock
cancleBlock
:(
DoraemonAlertCancleActionBlock
)
cancleBlock
{
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
DoraemonLocalizedString
(
@"提示"
)
message
:
text
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
cancelAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"取消"
)
style
:
UIAlertActionStyleCancel
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
cancleBlock
?
cancleBlock
():
nil
;
}];
UIAlertAction
*
okAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"确定"
)
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
okBlock
?
okBlock
():
nil
;
}];
[
alertController
addAction
:
cancelAction
];
[
alertController
addAction
:
okAction
];
[
vc
presentViewController
:
alertController
animated
:
YES
completion
:
nil
];
}
@end
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.h
浏览文件 @
18c697e2
...
...
@@ -7,22 +7,8 @@
#import <Foundation/Foundation.h>
typedef
void
(
^
DoraemonHandleRestartActionBlock
)(
void
);
typedef
void
(
^
DoraemonHandleRestartCancleActionBlock
)(
void
);
@interface
DoraemonToastUtil
:
NSObject
+
(
void
)
showToast
:(
NSString
*
)
text
inView
:(
UIView
*
)
superView
;
+
(
void
)
handleRestartActionWithVC
:(
UIViewController
*
)
vc
restartBlock
:(
DoraemonHandleRestartActionBlock
)
restartBlock
cancleBlock
:(
DoraemonHandleRestartCancleActionBlock
)
cancleBlock
;
+
(
void
)
handleRestartActionWithVC
:(
UIViewController
*
)
vc
text
:(
NSString
*
)
text
restartBlock
:(
DoraemonHandleRestartActionBlock
)
restartBlock
cancleBlock
:(
DoraemonHandleRestartCancleActionBlock
)
cancleBlock
;
@end
iOS/DoraemonKit/Src/Core/CommonUI/Toast/DoraemonToastUtil.m
浏览文件 @
18c697e2
...
...
@@ -9,9 +9,6 @@
#import "UIColor+Doraemon.h"
#import "UIView+Doraemon.h"
#import "Doraemoni18NUtil.h"
#import "DoraemonCellSwitch.h"
@implementation
DoraemonToastUtil
...
...
@@ -34,27 +31,4 @@
}
+
(
void
)
handleRestartActionWithVC
:(
UIViewController
*
)
vc
restartBlock
:(
DoraemonHandleRestartActionBlock
)
restartBlock
cancleBlock
:(
DoraemonHandleRestartCancleActionBlock
)
cancleBlock
{
[
self
handleRestartActionWithVC
:
vc
text
:
DoraemonLocalizedString
(
@"该功能需要重启App才能生效"
)
restartBlock
:
restartBlock
cancleBlock
:
cancleBlock
];
}
+
(
void
)
handleRestartActionWithVC
:(
UIViewController
*
)
vc
text
:(
NSString
*
)
text
restartBlock
:(
DoraemonHandleRestartActionBlock
)
restartBlock
cancleBlock
:(
DoraemonHandleRestartCancleActionBlock
)
cancleBlock
{
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
DoraemonLocalizedString
(
@"提示"
)
message
:
text
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
cancelAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"取消"
)
style
:
UIAlertActionStyleCancel
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
cancleBlock
?
cancleBlock
():
nil
;
}];
UIAlertAction
*
okAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"确定"
)
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
restartBlock
?
restartBlock
():
nil
;
}];
[
alertController
addAction
:
cancelAction
];
[
alertController
addAction
:
okAction
];
[
vc
presentViewController
:
alertController
animated
:
YES
completion
:
nil
];
}
@end
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
浏览文件 @
18c697e2
...
...
@@ -15,6 +15,7 @@
#import "UIImage+Doraemon.h"
#import "Doraemoni18NUtil.h"
#import "DoraemonToastUtil.h"
#import "DoraemonAlertUtil.h"
#define DoraemonScreenWidth [UIScreen mainScreen].bounds.size.width
#define DoraemonScreenHeight [UIScreen mainScreen].bounds.size.height
...
...
iOS/DoraemonKit/Src/Core/Plugin/AllTest/DoraemonAllTestViewController.m
浏览文件 @
18c697e2
...
...
@@ -88,7 +88,7 @@
-
(
void
)
okBtnClick
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
text
:
@"是否确认"
restart
Block
:^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
text
:
@"是否确认"
ok
Block
:^
{
weakSelf
.
okBtnStatus
=
!
weakSelf
.
okBtnStatus
;
[
DoraemonAllTestManager
shareInstance
].
startTestOn
=
weakSelf
.
okBtnStatus
;
if
(
weakSelf
.
okBtnStatus
)
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/Crash/DoraemonCrashViewController.m
浏览文件 @
18c697e2
...
...
@@ -66,7 +66,7 @@
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[[
DoraemonCacheManager
sharedInstance
]
saveCrashSwitch
:
on
];
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/NSLog/DoraemonNSLogViewController.m
浏览文件 @
18c697e2
...
...
@@ -47,7 +47,7 @@
#pragma mark -- DoraemonSwitchViewDelegate
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[[
DoraemonCacheManager
sharedInstance
]
saveNSLogSwitch
:
on
];
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/StartTime/DoraemonStartTimeViewController.m
浏览文件 @
18c697e2
...
...
@@ -76,7 +76,7 @@ static NSTimeInterval endTime;
#pragma mark -- DoraemonSwitchViewDelegate
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[[
DoraemonCacheManager
sharedInstance
]
saveStartTimeSwitch
:
on
];
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/SubThreadUICheck/DoraemonSubThreadUICheckViewController.m
浏览文件 @
18c697e2
...
...
@@ -48,7 +48,7 @@
#pragma mark -- DoraemonSwitchViewDelegate
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[[
DoraemonCacheManager
sharedInstance
]
saveSubThreadUICheckSwitch
:
on
];
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKit/Src/Logger/DoraemonCocoaLumberjackViewController.m
浏览文件 @
18c697e2
...
...
@@ -47,7 +47,7 @@
#pragma mark -- DoraemonSwitchViewDelegate
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[[
DoraemonCacheManager
sharedInstance
]
saveLoggerSwitch
:
on
];
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKit/Src/MethodUseTime/DoraemonMethodUseTimeViewController.m
浏览文件 @
18c697e2
...
...
@@ -47,7 +47,7 @@
#pragma mark -- DoraemonSwitchViewDelegate
-
(
void
)
changeSwitchOn
:(
BOOL
)
on
sender
:(
id
)
sender
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
Doraemon
ToastUtil
handleRestartActionWithVC
:
self
restart
Block
:
^
{
[
Doraemon
AlertUtil
handleAlertActionWithVC
:
self
ok
Block
:
^
{
[
DoraemonMethodUseTimeManager
sharedInstance
].
on
=
on
;
exit
(
0
);
}
cancleBlock
:^
{
...
...
iOS/DoraemonKitDemo/Podfile.lock
浏览文件 @
18c697e2
...
...
@@ -24,33 +24,33 @@ PODS:
- CocoaLumberjack (3.5.3):
- CocoaLumberjack/Core (= 3.5.3)
- CocoaLumberjack/Core (3.5.3)
- DoraemonKit/Core (1.2.
1
):
- DoraemonKit/Core (1.2.
2
):
- BSBacktraceLogger
- fishhook
- PNChart
- DoraemonKit/WithDatabase (1.2.
1
):
- DoraemonKit/WithDatabase (1.2.
2
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- YYDebugDatabase
- DoraemonKit/WithGPS (1.2.
1
):
- DoraemonKit/WithGPS (1.2.
2
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithLoad (1.2.
1
):
- DoraemonKit/WithLoad (1.2.
2
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithLogger (1.2.
1
):
- DoraemonKit/WithLogger (1.2.
2
):
- BSBacktraceLogger
- CocoaLumberjack
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithWeex (1.2.
1
):
- DoraemonKit/WithWeex (1.2.
2
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
...
...
@@ -113,7 +113,7 @@ SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
BSBacktraceLogger: 06b983ee93a9f87d957960e9c73d660d5966b447
CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947
DoraemonKit:
2d0d3bf18a5181f750d5bfead5030403ba3fbb2e
DoraemonKit:
ea50d30db95bd7ce978e964b2bb90c588a19a2a3
fishhook: ea19933abfe8f2f52c55fd8b6e2718467d3ebc89
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GCDWebServer: ead88cd14596dd4eae4f5830b8877c87c8728990
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录