浏览代码

1.控制2秒内回到前台不显示密码界面 (修复点击底部区域或下滑操作,返回输入密码界面)

huangxiaodong 1 年之前
父节点
当前提交
49236ca566
共有 1 个文件被更改,包括 32 次插入20 次删除
  1. 32 20
      创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

+ 32 - 20
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -63,6 +63,8 @@
 
 @property (nonatomic, assign)  BOOL isFirstOpenInLaunch;//启动页停两秒
 
+@property (nonatomic, assign)  NSTimeInterval preEnterBackgroundTime;//记录盒子的的后台时间 用来控制进入后台一秒内回到前台不显示密码界面 (点击底部区域或下滑操作,返回输入密码界面)
+
 //冷启动分享跳入用
 @property(nonatomic, strong)   UISceneSession *session;
 @property(nonatomic, strong)   UISceneConnectionOptions *connectionOptions;
@@ -540,18 +542,14 @@
 
 
 - (void)sceneDidBecomeActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
-//    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
-//    if (haveGuide) {
-//        ;
-//    }else {
-//        
-//        return;
-//    }
-//    [self showCalculatorVC];
-}
-
-
-- (void)sceneWillResignActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    //控制2秒内回到前台不显示密码界面
+    long seconds =  [iTools getNowTimeStampSS];
+    if(_preEnterBackgroundTime > 0){
+        if(seconds - _preEnterBackgroundTime <= 2000){
+            return;
+        }
+    }
+    
     BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
     if (haveGuide) {
         ;
@@ -563,20 +561,34 @@
 }
 
 
+- (void)sceneWillResignActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    
+    _preEnterBackgroundTime = [iTools getNowTimeStampSS];
+//    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
+//    if (haveGuide) {
+//        ;
+//    }else {
+//        
+//        return;
+//    }
+//    [self showCalculatorVC];
+}
+
+
 - (void)sceneWillEnterForeground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
 
 }
 
 
 - (void)sceneDidEnterBackground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
-    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
-    if (haveGuide) {
-        ;
-    }else {
-        
-        return;
-    }
-    [self showCalculatorVC];
+//    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
+//    if (haveGuide) {
+//        ;
+//    }else {
+//        
+//        return;
+//    }
+//    [self showCalculatorVC];
 }
 
 - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {