mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
UI optimizations
This commit is contained in:
@@ -6,6 +6,22 @@ public enum DeviceType {
|
||||
}
|
||||
|
||||
public enum DeviceMetrics: CaseIterable, Equatable {
|
||||
public struct Performance {
|
||||
public let isGraphicallyCapable: Bool
|
||||
|
||||
init() {
|
||||
var length: Int = 4
|
||||
var cpuCount: UInt32 = 0
|
||||
sysctlbyname("hw.ncpu", &cpuCount, &length, nil, 0)
|
||||
|
||||
#if DEBUG
|
||||
cpuCount = 2
|
||||
#endif
|
||||
|
||||
self.isGraphicallyCapable = cpuCount >= 6
|
||||
}
|
||||
}
|
||||
|
||||
case iPhone4
|
||||
case iPhone5
|
||||
case iPhone6
|
||||
@@ -33,6 +49,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
|
||||
case iPadPro3rdGen
|
||||
case iPadMini6thGen
|
||||
case unknown(screenSize: CGSize, statusBarHeight: CGFloat, onScreenNavigationHeight: CGFloat?)
|
||||
|
||||
public static let performance = Performance()
|
||||
|
||||
public static var allCases: [DeviceMetrics] {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user