无故事王国
2023-10-25 158f3707711ad4be78a55dc73a98aa1c9acda0dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
    //
    //  Def.swift
    //  BrokerDriver
    //
    //  Created by 无故事王国 on 2023/4/24.
    //
 
import Foundation
import UIKit
import MBProgressHUD
@_exported import JQTools
@_exported import QMUIKit
@_exported import HandyJSON
@_exported import RxSwift
 
 
    // MARK: -- Shorthand
let app = UIApplication.shared.delegate as! AppDelegate
 
var screnDelegate:SceneDelegate? = {
    var uiScreen:UIScene?
    UIApplication.shared.connectedScenes.forEach { scenes in
        uiScreen = scenes
    }
    return (uiScreen?.delegate as? SceneDelegate)
}()
 
var topSafeHeight:Double{
    return JQ_currentNavigationController().navigationBar.frame.height + UIApplication.shared.statusBarFrame.height
}
 
 
let notiCenter = NotificationCenter.default
 
func LogSuccess(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("✅✅✅ SUCCESS: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
func LogError(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("❌❌❌ ERROR: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
func LogInfo(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("⚠️⚠️⚠️INFO: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
 
    // MARK: -- Front
let Def_NavFont:UIFont = UIFont.systemFont(ofSize: 19, weight: .bold)
 
 
    // MARK: -- Color
let Def_NavFontColor:UIColor = .color(light: .color("#333333"), dark: .color("#333333"))
let Def_backgroundColor:UIColor = .color(light: .white, dark: .white)
let Def_ThemeColor:UIColor = .color(light: .color("#FED703"), dark: .color("#FED703"))
 
 
    //提示框
func alert(msg: String) {
    let hud = MBProgressHUD.showAdded(to: screnDelegate!.window!, animated: true)
    hud.mode = .text
    hud.label.text = msg
        //    hud.backgroundColor = UIColor.RGBA(r: 228, g: 228, b: 228, a: 1)
    hud.label.textColor = UIColor(hexString: "#343434")
    hud.label.numberOfLines = 0
    hud.label.font = UIFont.boldSystemFont(ofSize: 14)
    hud.hide(animated: true, afterDelay: 1.7)
}
 
// MARK: -- Key
 
let GoogleAppKey = "AIzaSyBBW0XxW1FK7IXmmS7KFtAjX3o99eFPsss"