WallPaperHome722/WallpaperHD_Live/AppDelegate.swift
2024-07-23 11:43:02 +08:00

43 lines
1.2 KiB
Swift

//
// AppDelegate.swift
// WallpaperHD_Live
//
// Created by 16 on 2024/7/22.
//
import UIKit
import IQKeyboardManagerSwift
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let hasLaunchedBeforeKey = "hasLaunchedBefore"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
IQKeyboardManager.shared.enable = true
window = UIWindow(frame: UIScreen.main.bounds)
// WP_TabbarCommon.TabBarController()
let userDefaults = UserDefaults.standard
if userDefaults.bool(forKey: hasLaunchedBeforeKey){
if userDefaults.bool(forKey: "islock"){
let vc = WP_LockVC()
self.window?.rootViewController = WP_RootNAV(rootViewController: vc)
}else{
WP_TabbarCommon.TabBarController()
}
}else{
//
userDefaults.set(true, forKey: hasLaunchedBeforeKey)
userDefaults.set(false, forKey: "islock")
WP_TabbarCommon.TabBarController()
}
self.window?.makeKeyAndVisible()
return true
}
}