Commit 8ea2f362 authored by David黄金龙's avatar David黄金龙

添加 条件编译代码

parent 04252921
......@@ -8,15 +8,16 @@
import UIKit
import ESTabBarController_swift
import IQKeyboardManagerSwift
import SmartCodable
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//1.设置主窗口
setupRootVC()
//2.通用UI设置
setupWholeUI()
return true
......@@ -25,10 +26,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
extension AppDelegate {
//2.通用全局UI设置相关
private func setupWholeUI() -> Void {
DispatchQueue.global().async {
//异步延迟设置
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.25) { [self] in
......@@ -36,50 +37,50 @@ extension AppDelegate {
//1.1
UITextField.appearance().tintColor = .mainColor
UITextView.appearance().tintColor = .mainColor
//1.2设置UINavigationBar title的字体和颜色
let titleTextAttributes = [NSAttributedString.Key.font : UIFont.PFSCM(ofSize: 16) , NSAttributedString.Key.foregroundColor : UIColor.commonColor100]
UINavigationBar.appearance().titleTextAttributes = titleTextAttributes
UINavigationBar.appearance().tintColor = .white
//1.3UITabBar bar 的选中颜色
UITabBar.appearance().tintColor = UIColor.commonColor100
//1.4tabbar默认的背景色
UITabBar.appearance().barTintColor = UIColor.white
//2、一键登录初始化
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
//3.微信登录初始化
// BsWxLoginManager.shared.doWxInit()
// BsWxLoginManager.shared.doWxInit()
//4.
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
IQKeyboardManager.shared.shouldResignOnTouchOutside = true // 控制点击背景是否收起键盘
//webView 预加载
// BsWebViewPreloadManager.share.addPreloadingView()
// BsWebViewPreloadManager.share.addPreloadingView()
//
customAppearance()
}
}
YHNetworkStatusManager.shared.listenNetWorkStatus()
}
//1.设置主窗口
private func setupRootVC() {
let tabBarController = YHTabBarViewController()
let v1 = YHNavigationController(rootViewController: YHIntelligentServiceViewController())
let v2 = YHNavigationController(rootViewController:YHMyViewController())
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "智慧服务", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "我的", image: UIImage(named: "find"), selectedImage: UIImage(named: "find_1"))
tabBarController.viewControllers = [v1, v2]
tabBarController.tabBar.backgroundColor = .white
......@@ -88,6 +89,13 @@ extension AppDelegate {
window?.rootViewController = tabBarController
window?.makeKeyAndVisible()
window?.backgroundColor = .white
//处理数据解析
#if DEBUG
SmartConfig.debugMode = .verbose
#else
SmartConfig.debugMode = .none
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment