Commit 277f5d93 authored by David黄金龙's avatar David黄金龙

处理 UI 基础框架

parent e54953ea
......@@ -27,4 +27,11 @@ target 'galaxy' do
pod 'SwifterSwift','6.0.0'
#下拉刷新、上拉更多
pod 'ESPullToRefresh',"2.9.3"
# #数据模型转换
pod 'HandyJSON','5.0.2'
# #提示框
pod 'PKHUD','5.3.0'
end
This diff is collapsed.
......@@ -14,21 +14,78 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
setupMainWindow()
//1.设置主窗口
setupRootVC()
//2.通用UI设置
setupWholeUI()
return true
}
}
extension AppDelegate {
//2.通用全局UI设置相关
private func setupWholeUI() -> Void {
DispatchQueue.global().async {
//异步延迟设置
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.25) { [self] in
//1、系统控件属性设置
//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)
//3.微信登录初始化
// BsWxLoginManager.shared.doWxInit()
//4.
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
IQKeyboardManager.shared.shouldResignOnTouchOutside = true // 控制点击背景是否收起键盘
//webView 预加载
BsWebViewPreloadManager.share.addPreloadingView()
//
customAppearance()
}
}
YHNetworkStatusManager.shared.listenNetWorkStatus()
}
//1.设置主窗口
private func setupMainWindow() {
let tabBarController = YHTabbarViewController()
let v1 = YHNavigationViewController(rootViewController: YHHomeViewController())
private func setupRootVC() {
let tabBarController = YHTabBarViewController()
let v1 = YHNavigationController(rootViewController: YHHomeViewController())
let v2 = YHNavigationController(rootViewController:YHMyViewController())
let v2 = YHNavigationViewController(rootViewController:YHMyViewController())
// let vc3 = YHHomeViewController()
// let v3 = BsNavigationController(rootViewController: vc3)
// let v4 = BsNavigationController(rootViewController: YHHomeViewController())
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"))
// v3.tabBarItem = ESTabBarItem.init(BsBouncesContentView(), title: "安睡", image: UIImage(named: "photo"), selectedImage: UIImage(named: "photo_1"))
// v4.tabBarItem = ESTabBarItem.init(BsBouncesContentView(), title: "我的", image: UIImage(named: "me"), selectedImage: UIImage(named: "me_1"))
v1.tabBarItem = ESTabBarItem.init(ESTabBarItemContentView(), title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v2.tabBarItem = ESTabBarItem.init(ESTabBarItemContentView(), title: "我的", image: UIImage(named: "main"), selectedImage: UIImage(named: "find_1"))
tabBarController.viewControllers = [v1, v2]
tabBarController.tabBar.backgroundColor = .white
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "favor.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "favor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/product2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/product2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/product1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/product1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/product2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/product2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/home1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/home1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/home2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/home2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/my1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/my1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/my2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/my2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/music1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/music1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon/24/tabbar/music2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon/24/tabbar/music2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// YHBaseViewController.swift
// galaxy
//
// Created by EDY on 2023/12/20.
//
import UIKit
class YHBaseViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
//
// YHNavigationViewController.swift
// galaxy
//
// Created by EDY on 2023/12/20.
//
import UIKit
class YHNavigationViewController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
//
// YHTabbarViewController.swift
// galaxy
//
// Created by EDY on 2023/12/20.
//
import UIKit
import ESTabBarController_swift
class YHTabbarViewController: ESTabBarController {
override func viewDidLoad() {
super.viewDidLoad()
self.tabBar.shadowImage = UIImage()
self.tabBar.backgroundImage = UIImage()
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
......@@ -11,7 +11,8 @@ class YHHomeViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
print("22222")
view.backgroundColor = .purple
// Do any additional setup after loading the view.
}
......
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