NcAppDelegate.swift 1.8 KB
//
//  NcAppDelegate.swift
//  NumberCube
//
//  Created by ilCode on 2025/3/27.
//

import UIKit

@main
class NcAppDelegate: UIResponder, UIApplicationDelegate {
    var kWindow: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Thread.sleep(forTimeInterval: 2)
        
//        initLogger()
        initNaviBar()
        initWindow()
        
        return true
    }
}

extension NcAppDelegate {
//    private func initLogger() {
//        _ = HiLoggerTools()
//    }
    
    private func initNaviBar() {
        GKConfigure.setupCustom {
            // 导航栏标题颜色
            $0.titleColor = hexColor("#0A120A")
            // 导航栏标题字体
            $0.titleFont = ncFont(18, isBold: true)
            // 导航栏返回按钮样式
            $0.backStyle = .black
            // 状态栏样式
            $0.statusBarStyle = .lightContent
            // 导航栏左右item间距
            $0.gk_navItemLeftSpace = 15
            $0.gk_navItemRightSpace = 15
            // 是否恢复系统导航
            $0.gk_restoreSystemNavBar = true
            // 设置导航栏背景色
//            $0.backgroundImage = R.image.navibar_bg()
            
            // 缩放配置
            $0.gk_scaleX = 0.90
            $0.gk_scaleY = 0.92
            
            // 开启全局UIScrollView处理
            $0.gk_openScrollViewGestureHandle = true
            
            // 跳转的时候隐藏标签栏
            $0.gk_hidesBottomBarWhenPushed = true
        }
    }
    
    private func initWindow() {
        kWindow = UIWindow.init(frame: UIScreen.main.bounds)
        kWindow?.backgroundColor = .white
        kWindow?.rootViewController = EntryController()
        kWindow?.makeKeyAndVisible()
    }
}