一系列bug

This commit is contained in:
DDIsFriend
2023-09-12 18:58:43 +08:00
parent 66a3708532
commit 220155ce89
63 changed files with 13460 additions and 10213 deletions

View 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 "未知"
}
}

View 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 "未知"
}
}

View 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)
}
}
}

19
Pods/DDUtilsSwiftKit_Private/LICENSE generated Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2023 DDIsFriend <DDIsFriend@163.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

29
Pods/DDUtilsSwiftKit_Private/README.md generated Normal file
View File

@@ -0,0 +1,29 @@
# DDUtilsSwiftKit_Private
[![CI Status](https://img.shields.io/travis/DDIsFriend/DDUtilsSwiftKit_Private.svg?style=flat)](https://travis-ci.org/DDIsFriend/DDUtilsSwiftKit_Private)
[![Version](https://img.shields.io/cocoapods/v/DDUtilsSwiftKit_Private.svg?style=flat)](https://cocoapods.org/pods/DDUtilsSwiftKit_Private)
[![License](https://img.shields.io/cocoapods/l/DDUtilsSwiftKit_Private.svg?style=flat)](https://cocoapods.org/pods/DDUtilsSwiftKit_Private)
[![Platform](https://img.shields.io/cocoapods/p/DDUtilsSwiftKit_Private.svg?style=flat)](https://cocoapods.org/pods/DDUtilsSwiftKit_Private)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
DDUtilsSwiftKit_Private is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'DDUtilsSwiftKit_Private'
```
## Author
DDIsFriend, DDIsFriend@163.com
## License
DDUtilsSwiftKit_Private is available under the MIT license. See the LICENSE file for more info.