Commit 9589b1b9 authored by David黄金龙's avatar David黄金龙

1、日志输出

2、首页添加相应资源
parent fc65b59e
...@@ -287,9 +287,9 @@ ...@@ -287,9 +287,9 @@
A5ACE8D72B4564F7002C94D2 /* Classes */ = { A5ACE8D72B4564F7002C94D2 /* Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5ACE91B2B4564F7002C94D2 /* Modules */,
A5ACE91E2B4564F7002C94D2 /* Base */, A5ACE91E2B4564F7002C94D2 /* Base */,
A5ACE8EE2B4564F7002C94D2 /* Tools */, A5ACE8EE2B4564F7002C94D2 /* Tools */,
A5ACE91B2B4564F7002C94D2 /* Modules */,
); );
path = Classes; path = Classes;
sourceTree = "<group>"; sourceTree = "<group>";
......
...@@ -107,10 +107,6 @@ extension AppDelegate { ...@@ -107,10 +107,6 @@ extension AppDelegate {
} }
YHNetworkStatusManager.shared.listenNetWorkStatus() YHNetworkStatusManager.shared.listenNetWorkStatus()
} }
//1.设置主窗口 //1.设置主窗口
......
...@@ -37,7 +37,9 @@ class YHBaseViewController: UIViewController { ...@@ -37,7 +37,9 @@ class YHBaseViewController: UIViewController {
} }
deinit { deinit {
#if DEBUG #if DEBUG
print(#function) // print(type(of: self))
// print("执行了方法:",terminator: "\t")
printLog(#function)
#endif #endif
} }
} }
......
...@@ -17,6 +17,13 @@ class YHHomeViewController: YHBaseViewController { ...@@ -17,6 +17,13 @@ class YHHomeViewController: YHBaseViewController {
return YHHomePageViewModel() return YHHomePageViewModel()
}() }()
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "home_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -52,8 +59,18 @@ class YHHomeViewController: YHBaseViewController { ...@@ -52,8 +59,18 @@ class YHHomeViewController: YHBaseViewController {
} }
private func initView()->Void { private func initView()->Void {
navigationItem.title = "首页" navigationItem.title = ""
view.backgroundColor = UIColor(hex:0xE9E9E9) view.backgroundColor = UIColor(hex:0xE9E9E9)
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(307)
}
} }
} }
...@@ -30,7 +30,7 @@ extension YHHomePageViewModel { ...@@ -30,7 +30,7 @@ extension YHHomePageViewModel {
return return
} }
self.subject.onNext(YHHomeCofigMode()) self.subject.onNext(YHHomeCofigMode())
print("model 是 ==>",model) printLog("model 是 ==> \(model)")
} failBlock: { err in } failBlock: { err in
print(err) print(err)
} }
......
...@@ -187,14 +187,3 @@ extension String { ...@@ -187,14 +187,3 @@ extension String {
} }
} }
/// 打印
///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
print("\n[文件]:\((file as NSString).lastPathComponent) [所在行]:\(line),[方法名称]:\(method),[具体信息]:\(message)")
}
...@@ -12,14 +12,20 @@ import UIKit ...@@ -12,14 +12,20 @@ import UIKit
let APP_NAME = Bundle.main.infoDictionary!["CFBundleName"] as! String let APP_NAME = Bundle.main.infoDictionary!["CFBundleName"] as! String
func YHLOG<T>(message:T,file:String = #file,funcName:String = #function,lineName:Int = #line){ /// 打印
//这个DEBUG 是一个debug时候的一个flag需要自己去xcode设置项设置。 ///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
#if DEBUG #if DEBUG
let flieName = (file as NSString).lastPathComponent print("\n开始一段日志输出=========>\n[文件]:\((file as NSString).lastPathComponent)\n[所在行]:\(line)\n[方法名称]:\(method)\n[打印信息]:\(message)\n结束该段日志输出<=========\n\n\n")
print("\(APP_NAME)/\(flieName)/\(funcName)/\(lineName):\(message)")
#endif #endif
} }
///屏幕宽度 ///屏幕宽度
let KScreenWidth = UIScreen.main.bounds.size.width let KScreenWidth = UIScreen.main.bounds.size.width
///屏幕高度 ///屏幕高度
......
...@@ -106,7 +106,7 @@ class YHNetRequest: NSObject { ...@@ -106,7 +106,7 @@ class YHNetRequest: NSObject {
httpRequest?.responseString(completionHandler: { string in httpRequest?.responseString(completionHandler: { string in
#if DEBUG #if DEBUG
print("\n网络请求已返回 string=\(string)") printLog("\n网络请求已返回 string=\(string)")
#endif #endif
self.completeHandle(string: string) self.completeHandle(string: string)
}) })
...@@ -207,12 +207,12 @@ class YHNetRequest: NSObject { ...@@ -207,12 +207,12 @@ class YHNetRequest: NSObject {
extension YHNetRequest { extension YHNetRequest {
class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? { class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)") printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest() return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest()
} }
class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? { class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)") printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest() return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest()
} }
} }
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Rectangle 8235.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 8235@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 8235@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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