CNLiveConfigMacro.swift
1.39 KB
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
//
// CNLiveConfigMacro.swift
// metaCode
//
// Created by open on 2023/5/31.
//
import Foundation
import UIKit
/// App 显示名称
let kAppDisplayName = Bundle.main.infoDictionary?["CFBundleDisplayName"] ?? ""
/// App BundleName
let kAppName = Bundle.main.infoDictionary![kCFBundleNameKey as String] ?? ""
/// App BundleID
let kAppBundleID = Bundle.main.bundleIdentifier ?? ""
/// App 版本号
let kAppVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] ?? ""
/// App BuildNumber
let kAppBuildNumber = Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) ?? ""
/// App Language en
let kAPPLanguage = NSLocale.preferredLanguages[0]
let kApplication = UIApplication.shared
let keyWindow = UIApplication.shared.keyWindow
let appDelegate = UIApplication.shared.delegate
let userDefaults = UserDefaults.standard
let notificationCenter = NotificationCenter.default
// MARK: - 打印输出
/// 默认打印
public func log<T>(_ message: T) {
#if DEBUG
print("\(message)")
#endif
}
/// 全部打印
public func aLog<T>(_ message: T, file: String = #file, funcName: String = #function, lineNum: Int = #line) {
#if DEBUG
let fileName = (file as NSString).lastPathComponent
print("\n********** JhAllLog-satrt ***********\n\n文件名称:\(fileName)\n方法名称:\(funcName)\n行数:\(lineNum)\n信息:\n\n\(message)\n\n********** JhAllLog-end ***********\n")
#endif
}