- add necessary UI tips

- restore "view all apps" for host card
- minor fixes
This commit is contained in:
True Zhuanjia
2026-02-26 22:32:37 +08:00
parent f325e9a206
commit 0728e999eb
14 changed files with 123 additions and 58 deletions
+52
View File
@@ -0,0 +1,52 @@
//
// GenericUtils.swift
// VoidLink
//
// Created by True砖家 on 2026/2/26.
// Copyright © 2026 True砖家@Bilibili. All rights reserved.
//
import Foundation
@objc public class GenericUtils: NSObject {
@objc static func needUpdateDefaultSettings() -> Bool {
// let key = "needUpdateDefaultSettings20260226-1"
let key = "needUpdateDefaultSettings20260226-2"
guard !UserDefaults.standard.bool(forKey: key) else {
return false
}
UserDefaults.standard.set(true, forKey: key)
return true
}
@objc static func isEnableOswForNativeTouchSwitchFirstFlipping() -> Bool {
let key = "enableOswForNativeTouchSwitchFlipped"
guard !UserDefaults.standard.bool(forKey: key) else {
return false
}
UserDefaults.standard.set(true, forKey: key)
return true
}
@objc static func isFirstLaunchPressureCurveTool() -> Bool {
let key = "hasLaunchedPressureCurveTool"
let defaults = UserDefaults.standard
let launchedBefore = defaults.bool(forKey: key)
if !launchedBefore {
defaults.set(true, forKey: key)
return true
}
return false
}
@objc static func isIPhone() -> Bool {
return UIDevice.current.userInterfaceIdiom == .phone
}
@objc static func isIPad() -> Bool {
return UIDevice.current.userInterfaceIdiom == .pad
}
}