想要在app启动和每次唤醒的时候 都能先跳到一个输入密码的界面 输入密码正确的时候才能进入主界面
现在有一个自己做的用来设置新密码的view 可不是全屏的 想问一下能否把这个view拉伸到全屏 实现密码解锁和重新设置密码两种功能

解决方案 »

  1.   

    找到你这个view所在的viewController,然后直接设置view.frame = viewController.bounds就是全屏了
      

  2.   


    // 监听appdelegate中的
     func applicationDidBecomeActive(_ application: UIApplication) {
        // 获取到当前控制器
        let currentController = // 自己获取
        // present密码控制器
        currentController.present....(passwordController, ...)
    }
    如此还能再passwordController中处理密码的业务
      

  3.   

    建议新建一个Window,需要时在becomeActive的时候把它makeKeyAndVisible
    这样的好处是可以单独写一个controller,用来处理密码的输入和判断。
      

  4.   

    - (void)applicationDidBecomeActive:(UIApplication *)application {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }这方法中写逻辑
      

  5.   

    - (void)applicationDidBecomeActive:(UIApplication *)application {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }代码处理中,找到rootViewController,增加一个全屏 subview,然后bringsubviewtotop,处理密码事件完成后 removesubview。
      

  6.   

    简单的做法:在每次applicationWillTerminate时退出登录