一系列bug
This commit is contained in:
25
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/ApplicationInfo/ApplicationInfo.swift
generated
Normal file
25
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/ApplicationInfo/ApplicationInfo.swift
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// ApplicationInfo.swift
|
||||
// DDSystemToolKit_Private
|
||||
// Created by DDIsFriend on 2023/9/12.
|
||||
//
|
||||
import Foundation
|
||||
|
||||
public let APPINFO = ApplicationInfo.default
|
||||
open class ApplicationInfo {
|
||||
public static let `default` = ApplicationInfo()
|
||||
|
||||
public func bundleVersionShort() -> String {
|
||||
if let info = Bundle.main.infoDictionary,let version = info["CFBundleShortVersionString"] as? String {
|
||||
return version
|
||||
}
|
||||
return "未知"
|
||||
}
|
||||
|
||||
public func bundleVersion() -> String {
|
||||
if let info = Bundle.main.infoDictionary,let version = info["CFBundleVersion"] as? String {
|
||||
return version
|
||||
}
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
59
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/DeviceInfo/DeviceInfo.swift
generated
Normal file
59
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/DeviceInfo/DeviceInfo.swift
generated
Normal file
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// DeviceInfo.swift
|
||||
// DDSystemToolKit_Private
|
||||
// Created by DDIsFriend on 2023/9/12.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public let DEVICEINFO = DeviceInfo.default
|
||||
open class DeviceInfo {
|
||||
public static let `default` = DeviceInfo()
|
||||
|
||||
public func deviceModel() -> 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 "未知"
|
||||
}
|
||||
}
|
||||
|
||||
32
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/UrlLinks/UrlLinks.swift
generated
Normal file
32
Pods/DDUtilsSwiftKit_Private/DDUtilsSwiftKit_Private/Classes/UrlLinks/UrlLinks.swift
generated
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// UrlSetting.swift
|
||||
// DDSystemToolKit_Private
|
||||
// Created by DDIsFriend on 2023/9/12.
|
||||
|
||||
import Foundation
|
||||
|
||||
public let URLLINKS = UrlLinks.default
|
||||
open class UrlLinks {
|
||||
public static let `default` = UrlLinks()
|
||||
|
||||
public enum UrlTypeEnum : String {
|
||||
case phone = "tel:"
|
||||
case mail = "mailto:"
|
||||
case sms = "sms:"
|
||||
case map = "http://maps.apple.com/?"
|
||||
}
|
||||
|
||||
public func openUrl(type:UrlTypeEnum,appending:String) {
|
||||
var urlString = type.rawValue
|
||||
urlString = urlString.appending(appending)
|
||||
if let url = URL(string: urlString),UIApplication.shared.canOpenURL(url) == true {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
||||
public func openSetting() {
|
||||
if let url = URL(string: UIApplicationOpenSettingsURLString),UIApplication.shared.canOpenURL(url) == true {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user