Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
8ea2f362
Commit
8ea2f362
authored
Dec 28, 2023
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 条件编译代码
parent
04252921
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+28
-20
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
8ea2f362
...
@@ -8,15 +8,16 @@
...
@@ -8,15 +8,16 @@
import
UIKit
import
UIKit
import
ESTabBarController_swift
import
ESTabBarController_swift
import
IQKeyboardManagerSwift
import
IQKeyboardManagerSwift
import
SmartCodable
@main
@main
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
{
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
{
var
window
:
UIWindow
?
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
//1.设置主窗口
//1.设置主窗口
setupRootVC
()
setupRootVC
()
//2.通用UI设置
//2.通用UI设置
setupWholeUI
()
setupWholeUI
()
return
true
return
true
...
@@ -25,10 +26,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
...
@@ -25,10 +26,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
extension
AppDelegate
{
extension
AppDelegate
{
//2.通用全局UI设置相关
//2.通用全局UI设置相关
private
func
setupWholeUI
()
->
Void
{
private
func
setupWholeUI
()
->
Void
{
DispatchQueue
.
global
()
.
async
{
DispatchQueue
.
global
()
.
async
{
//异步延迟设置
//异步延迟设置
DispatchQueue
.
main
.
asyncAfter
(
wallDeadline
:
.
now
()
+
0.25
)
{
[
self
]
in
DispatchQueue
.
main
.
asyncAfter
(
wallDeadline
:
.
now
()
+
0.25
)
{
[
self
]
in
...
@@ -36,50 +37,50 @@ extension AppDelegate {
...
@@ -36,50 +37,50 @@ extension AppDelegate {
//1.1
//1.1
UITextField
.
appearance
()
.
tintColor
=
.
mainColor
UITextField
.
appearance
()
.
tintColor
=
.
mainColor
UITextView
.
appearance
()
.
tintColor
=
.
mainColor
UITextView
.
appearance
()
.
tintColor
=
.
mainColor
//1.2设置UINavigationBar title的字体和颜色
//1.2设置UINavigationBar title的字体和颜色
let
titleTextAttributes
=
[
NSAttributedString
.
Key
.
font
:
UIFont
.
PFSCM
(
ofSize
:
16
)
,
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
.
commonColor100
]
let
titleTextAttributes
=
[
NSAttributedString
.
Key
.
font
:
UIFont
.
PFSCM
(
ofSize
:
16
)
,
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
.
commonColor100
]
UINavigationBar
.
appearance
()
.
titleTextAttributes
=
titleTextAttributes
UINavigationBar
.
appearance
()
.
titleTextAttributes
=
titleTextAttributes
UINavigationBar
.
appearance
()
.
tintColor
=
.
white
UINavigationBar
.
appearance
()
.
tintColor
=
.
white
//1.3UITabBar bar 的选中颜色
//1.3UITabBar bar 的选中颜色
UITabBar
.
appearance
()
.
tintColor
=
UIColor
.
commonColor100
UITabBar
.
appearance
()
.
tintColor
=
UIColor
.
commonColor100
//1.4tabbar默认的背景色
//1.4tabbar默认的背景色
UITabBar
.
appearance
()
.
barTintColor
=
UIColor
.
white
UITabBar
.
appearance
()
.
barTintColor
=
UIColor
.
white
//2、一键登录初始化
//2、一键登录初始化
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
//3.微信登录初始化
//3.微信登录初始化
// BsWxLoginManager.shared.doWxInit()
// BsWxLoginManager.shared.doWxInit()
//4.
//4.
IQKeyboardManager
.
shared
.
enable
=
true
IQKeyboardManager
.
shared
.
enable
=
true
IQKeyboardManager
.
shared
.
enableAutoToolbar
=
false
IQKeyboardManager
.
shared
.
enableAutoToolbar
=
false
IQKeyboardManager
.
shared
.
shouldResignOnTouchOutside
=
true
// 控制点击背景是否收起键盘
IQKeyboardManager
.
shared
.
shouldResignOnTouchOutside
=
true
// 控制点击背景是否收起键盘
//webView 预加载
//webView 预加载
// BsWebViewPreloadManager.share.addPreloadingView()
// BsWebViewPreloadManager.share.addPreloadingView()
//
//
customAppearance
()
customAppearance
()
}
}
}
}
YHNetworkStatusManager
.
shared
.
listenNetWorkStatus
()
YHNetworkStatusManager
.
shared
.
listenNetWorkStatus
()
}
}
//1.设置主窗口
//1.设置主窗口
private
func
setupRootVC
()
{
private
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
tabBarController
=
YHTabBarViewController
()
let
v1
=
YHNavigationController
(
rootViewController
:
YHIntelligentServiceViewController
())
let
v1
=
YHNavigationController
(
rootViewController
:
YHIntelligentServiceViewController
())
let
v2
=
YHNavigationController
(
rootViewController
:
YHMyViewController
())
let
v2
=
YHNavigationController
(
rootViewController
:
YHMyViewController
())
v1
.
tabBarItem
=
ESTabBarItem
.
init
(
YHBasicContentView
(),
title
:
"智慧服务"
,
image
:
UIImage
(
named
:
"home"
),
selectedImage
:
UIImage
(
named
:
"home_1"
))
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"
))
v2
.
tabBarItem
=
ESTabBarItem
.
init
(
YHBasicContentView
(),
title
:
"我的"
,
image
:
UIImage
(
named
:
"find"
),
selectedImage
:
UIImage
(
named
:
"find_1"
))
tabBarController
.
viewControllers
=
[
v1
,
v2
]
tabBarController
.
viewControllers
=
[
v1
,
v2
]
tabBarController
.
tabBar
.
backgroundColor
=
.
white
tabBarController
.
tabBar
.
backgroundColor
=
.
white
...
@@ -88,6 +89,13 @@ extension AppDelegate {
...
@@ -88,6 +89,13 @@ extension AppDelegate {
window
?
.
rootViewController
=
tabBarController
window
?
.
rootViewController
=
tabBarController
window
?
.
makeKeyAndVisible
()
window
?
.
makeKeyAndVisible
()
window
?
.
backgroundColor
=
.
white
window
?
.
backgroundColor
=
.
white
//处理数据解析
#if DEBUG
SmartConfig
.
debugMode
=
.
verbose
#else
SmartConfig
.
debugMode
=
.
none
#endif
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment