game profile system & selector

This commit is contained in:
True Zhuanjia
2026-04-22 12:46:51 +08:00
parent 9104a7b7b9
commit 7e21292a62
32 changed files with 926 additions and 330 deletions
@@ -0,0 +1,53 @@
//
// UIStackExtension.swift
// VoidLink
//
// Created by Weimin on 2026/4/17.
// Copyright © 2026 Moonlight Game Streaming Project. All rights reserved.
//
import UIKit
import ObjectiveC
private var isGameProfileSettingKey: UInt8 = 0
private var hasInfoTagKey: UInt8 = 0
private var hasDynamicLabelKey: UInt8 = 0
extension UIStackView {
@objc var isGameProfileSetting: Bool {
get {
return objc_getAssociatedObject(self, &isGameProfileSettingKey) as? Bool ?? false
}
set {
objc_setAssociatedObject(self,
&isGameProfileSettingKey,
newValue,
.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
@objc var hasInfoTag: Bool {
get {
return objc_getAssociatedObject(self, &hasInfoTagKey) as? Bool ?? false
}
set {
objc_setAssociatedObject(self,
&hasInfoTagKey,
newValue,
.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
@objc var hasDynamicLabel: Bool {
get {
return objc_getAssociatedObject(self, &hasDynamicLabelKey) as? Bool ?? false
}
set {
objc_setAssociatedObject(self,
&hasDynamicLabelKey,
newValue,
.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
}