diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate index 5afed3d..dfe90f8 100644 Binary files a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate and b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index a453324..2534f6e 100644 --- a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -3841,8 +3841,8 @@ filePath = "OrderScheduling/Global/Tool/Tool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "169" - endingLineNumber = "169" + startingLineNumber = "119" + endingLineNumber = "119" landmarkName = "playVoiceWith(userInfo:)" landmarkType = "7"> @@ -3889,8 +3889,8 @@ filePath = "OrderScheduling/Global/Tool/Tool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "160" - endingLineNumber = "160" + startingLineNumber = "110" + endingLineNumber = "110" landmarkName = "Tool" landmarkType = "3"> @@ -4097,8 +4097,8 @@ filePath = "OrderScheduling/Global/Tool/Tool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "181" - endingLineNumber = "181" + startingLineNumber = "131" + endingLineNumber = "131" landmarkName = "playVoiceWith(userInfo:)" landmarkType = "7"> diff --git a/OrderScheduling/Global/Tool/SystemCall.swift b/OrderScheduling/Global/Tool/SystemCall.swift index 776d599..ac40d5a 100644 --- a/OrderScheduling/Global/Tool/SystemCall.swift +++ b/OrderScheduling/Global/Tool/SystemCall.swift @@ -56,7 +56,7 @@ open class SystemCall { self?.isConnected = false self?.isDisconnected = false - self?.callTime = Date().dd_toString(format: "yyyy-MM-dd HH:mm:ss") + self?.callTime = Date().dd_toString(format: .yyyyMMddHHmmssDefault) self?.dialingTimeInterval = Date().timeIntervalSince1970 break case "CTCallStateIncoming": diff --git a/OrderScheduling/Global/Tool/Tool.swift b/OrderScheduling/Global/Tool/Tool.swift index 13ae88e..f80d459 100644 --- a/OrderScheduling/Global/Tool/Tool.swift +++ b/OrderScheduling/Global/Tool/Tool.swift @@ -70,56 +70,6 @@ open class Tool { } return dateString } - - public func getVersion() -> String { - return (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "1.0.0" - } - - public func getIPhoneCode() -> String { - var systemInfo = utsname() - uname(&systemInfo) - - let versionCode: String = String(validatingUTF8: NSString(bytes: &systemInfo.machine, length: Int(_SYS_NAMELEN), encoding: String.Encoding.ascii.rawValue)!.utf8String!)! - - switch versionCode { - /*** iPhone ***/ - case "iPhone5,1", "iPhone5,2": return "iPhone5" - case "iPhone5,3", "iPhone5,4": return "iPhone5C" - case "iPhone6,1", "iPhone6,2": return "iPhone5S" - case "iPhone7,2": return "iPhone6" - case "iPhone7,1": return "iPhone6Plus" - case "iPhone8,1": return "iPhone6S" - case "iPhone8,2": return "iPhone6SPlus" - case "iPhone8,3", "iPhone8,4": return "iPhoneSE" - case "iPhone9,1", "iPhone9,3": return "iPhone7" - case "iPhone9,2", "iPhone9,4": return "iPhone7Plus" - case "iPhone10,1", "iPhone10,4": return "iPhone8" - case "iPhone10,2", "iPhone10,5": return "iPhone8Plus" - case "iPhone10,3", "iPhone10,6": return "iPhoneX" - case "iPhone11,2": return "iPhoneXS" - case "iPhone11,4", "iPhone11,6": return "iPhoneXS_Max" - case "iPhone11,8": return "iPhoneXR" - case "iPhone12,1": return "iPhone11" - case "iPhone12,3": return "iPhone11Pro" - case "iPhone12,5": return "iPhone11Pro_Max" - case "iPhone12,8": return "iPhoneSE2" - case "iPhone13,1": return "iPhone12Mini" - case "iPhone13,2": return "iPhone12" - case "iPhone13,3": return "iPhone12Pro" - case "iPhone13,4": return "iPhone12Pro_Max" - case "iPhone14,4": return "iPhone13Mini" - case "iPhone14,5": return "iPhone13" - case "iPhone14,2": return "iPhone13Pro" - case "iPhone14,3": return "iPhone13Pro_Max" - case "iPhone14,7": return "iPhone14" - case "iPhone14,8": return "iPhone14Plus" - case "iPhone15,2": return "iPhone14Pro" - case "iPhone15,3": return "iPhone14Pro_Max" - default: - break - } - return "未知" - } // MARK: 远程推送相关 func getOrderString(userInfo:[AnyHashable:Any]?) -> String{ diff --git a/Podfile.lock b/Podfile.lock index 76624cc..4b027c1 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -179,7 +179,7 @@ PODS: - DDBasicControlsKit_Private/DDBaseView - DDControlsKit_Private/DDViewController (0.1.2): - DDBasicControlsKit_Private/DDBaseViewController - - DDDateKit_Private (0.1.0) + - DDDateKit_Private (0.1.1) - DDFontKit_Private (0.1.0) - DDLogKit_Private (0.1.4): - DDLogKit_Private/OCLog (= 0.1.4) @@ -391,7 +391,7 @@ SPEC CHECKSUMS: DDCategoryKit_Private: 19d515c43d5e9c4ee80b8ccf3fb8ab40368b8668 DDColorKit_Private: 77fddb62410a2d5e6fb003083d233c0d7ea0a08f DDControlsKit_Private: c3ac79b391cec6ecb26262a0d3b02718f696ab19 - DDDateKit_Private: d77cfb4eb068446a17fc6e7688b050ae2ca11d72 + DDDateKit_Private: f8348d10cec77ccacd2f5ec27d587ea2898ae90a DDFontKit_Private: 7b8f4ebf0f60622874036202734d8460dc7b3806 DDLogKit_Private: 1ed442cc7be004bd05f27bfda9b525e113df54e0 DDMAMapKit_Private: fda2942ba7a3b7da4d440e59a89db9fd6708d842 diff --git a/Pods/DDDateKit_Private/DDDateKit_Private/Classes/DDDate.swift b/Pods/DDDateKit_Private/DDDateKit_Private/Classes/DDDate.swift index d86a313..a658a3b 100644 --- a/Pods/DDDateKit_Private/DDDateKit_Private/Classes/DDDate.swift +++ b/Pods/DDDateKit_Private/DDDateKit_Private/Classes/DDDate.swift @@ -8,6 +8,12 @@ import Foundation public let DDDATE = DDDate.default +public enum DateFormatEnum : String { + case yyyyMMddHHmmssDefault = "yyyy-MM-dd HH:mm:ss" + case yyyyMMddDefault = "yyyy-MM-dd" + case HHmmssDefault = "HH:mm:ss" +} + open class DDDate { public static let `default` = DDDate() // 设置一个全局使用的 @@ -55,8 +61,8 @@ extension Date { /// - locale: 本地化 /// - timeZoneIdentifier: 时区 /// - Returns: 时间的字符串格式 - public func dd_toString(format:String,locale:String? = nil,timeZoneIdentifier:String? = nil) -> String { - return DDDATE.getDateFormatter(format: format,locale: locale,timeZoneIdentifier: timeZoneIdentifier).string(from: self) + public func dd_toString(format:DateFormatEnum,locale:String? = nil,timeZoneIdentifier:String? = nil) -> String { + return DDDATE.getDateFormatter(format: format.rawValue,locale: locale,timeZoneIdentifier: timeZoneIdentifier).string(from: self) } /// 判断date是不是昨天 @@ -103,14 +109,14 @@ extension Date { return "\(min)分钟前" } - return "今天\(dd_toString(format: "HH:mm:ss"))" + return "今天\(dd_toString(format: .HHmmssDefault))" } if isYesterday() == true { - return "昨天\(dd_toString(format: "HH:mm:ss"))" + return "昨天\(dd_toString(format: .HHmmssDefault))" } - return dd_toString(format: "yyyy-MM-dd HH:mm:ss") + return dd_toString(format: .yyyyMMddHHmmssDefault) } } @@ -120,9 +126,9 @@ extension String { /// - dateString: 比较的时间 /// - format: 比较时间的格式,时间比较需保持格式一致 /// - Returns: 大于返回true - public func dd_compare(dateString:String,format:String) -> ComparisonResult? { - let date = dd_toDate(format: self) - let compareDate = dd_toDate(format: self) + public func dd_compare(dateString:String,format:DateFormatEnum) -> ComparisonResult? { + let date = dd_toDate(format: format) + let compareDate = dateString.dd_toDate(format: format) guard date != nil,compareDate != nil else { return nil } @@ -135,15 +141,15 @@ extension String { /// - locale: 本地化区域 /// - timeZoneIdentifier: 时区 /// - Returns: date - public func dd_toDate(format:String,locale:String? = nil,timeZoneIdentifier:String? = nil) -> Date? { - return DDDATE.getDateFormatter(format: format,locale: locale,timeZoneIdentifier: timeZoneIdentifier).date(from: self) + public func dd_toDate(format:DateFormatEnum,locale:String? = nil,timeZoneIdentifier:String? = nil) -> Date? { + return DDDATE.getDateFormatter(format: format.rawValue,locale: locale,timeZoneIdentifier: timeZoneIdentifier).date(from: self) } /// 将字符串转换成时间戳秒 /// - Parameter format: 字符串时间格式 /// - Returns: 时间戳 - public func dd_timeIntervalSince1970(format:String) -> TimeInterval? { + public func dd_timeIntervalSince1970(format:DateFormatEnum) -> TimeInterval? { let date = dd_toDate(format: format) guard date != nil else { return nil @@ -154,7 +160,7 @@ extension String { /// 将字符串转换成时间戳毫秒 /// - Parameter format: 字符串时间格式 /// - Returns: 时间戳 - public func dd_timeIntervalSssSince1970(format:String) -> TimeInterval? { + public func dd_timeIntervalSssSince1970(format:DateFormatEnum) -> TimeInterval? { let timeInterval = dd_timeIntervalSince1970(format: format) guard timeInterval != nil else { return nil @@ -166,7 +172,7 @@ extension String { /// 当前时间是不是昨天 /// - Parameter format: 时间格式 /// - Returns: 是不是 - public func isYesterday(format:String) -> Bool { + public func isYesterday(format:DateFormatEnum) -> Bool { let date = dd_toDate(format: format) guard date != nil else { return false @@ -177,7 +183,7 @@ extension String { /// 当前时间是不是今天 /// - Parameter format: 时间格式 /// - Returns: 是不是 - public func isToday(format:String) -> Bool { + public func isToday(format:DateFormatEnum) -> Bool { let date = dd_toDate(format: format) guard date != nil else { return false @@ -188,7 +194,7 @@ extension String { /// 当前时间是不是明天 /// - Parameter format: 时间格式 /// - Returns: 是不是 - public func isTomorrow(format:String) -> Bool { + public func isTomorrow(format:DateFormatEnum) -> Bool { let date = dd_toDate(format: format) guard date != nil else { return false @@ -200,7 +206,7 @@ extension String { /// - Parameters: /// - format: 当前字符串时间的格式 /// - Returns: 字符串 - public func dd_pushNotificationDateFormatString(format:String) -> String? { + public func dd_pushNotificationDateFormatString(format:DateFormatEnum) -> String? { let date = dd_toDate(format: format) return date?.dd_pushNotificationDateFormatString() } diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 76624cc..4b027c1 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -179,7 +179,7 @@ PODS: - DDBasicControlsKit_Private/DDBaseView - DDControlsKit_Private/DDViewController (0.1.2): - DDBasicControlsKit_Private/DDBaseViewController - - DDDateKit_Private (0.1.0) + - DDDateKit_Private (0.1.1) - DDFontKit_Private (0.1.0) - DDLogKit_Private (0.1.4): - DDLogKit_Private/OCLog (= 0.1.4) @@ -391,7 +391,7 @@ SPEC CHECKSUMS: DDCategoryKit_Private: 19d515c43d5e9c4ee80b8ccf3fb8ab40368b8668 DDColorKit_Private: 77fddb62410a2d5e6fb003083d233c0d7ea0a08f DDControlsKit_Private: c3ac79b391cec6ecb26262a0d3b02718f696ab19 - DDDateKit_Private: d77cfb4eb068446a17fc6e7688b050ae2ca11d72 + DDDateKit_Private: f8348d10cec77ccacd2f5ec27d587ea2898ae90a DDFontKit_Private: 7b8f4ebf0f60622874036202734d8460dc7b3806 DDLogKit_Private: 1ed442cc7be004bd05f27bfda9b525e113df54e0 DDMAMapKit_Private: fda2942ba7a3b7da4d440e59a89db9fd6708d842