WallPaperHome722/WallpaperHD_Live/AppDelegate.swift
2024-07-25 19:20:41 +08:00

47 lines
1.3 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 isoneopenBeforeKey = "isoneopen"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
IQKeyboardManager.shared.enable = true
window = UIWindow(frame: UIScreen.main.bounds)
//
if #available(iOS 13.0, *) {
window?.overrideUserInterfaceStyle = .light
}
let userDefaults = UserDefaults.standard
if userDefaults.bool(forKey: isoneopenBeforeKey){
if userDefaults.bool(forKey: "islock"){
let vc = WP_LockVC()
self.window?.rootViewController = WP_RootNAV(rootViewController: vc)
}else{
WP_TabbarRootVC.TabBarController()
}
}else{
//
userDefaults.set(true, forKey: isoneopenBeforeKey)
userDefaults.set(false, forKey: "islock")
WP_TabbarRootVC.TabBarController()
}
self.window?.makeKeyAndVisible()
return true
}
}