gpt4 book ai didi

ios - 如何在 Xcode 的属性检查器中添加部分名称?

转载 作者:行者123 更新时间:2023-11-28 15:10:17 25 4
gpt4 key购买 nike

有没有办法在新添加的 @IBDesignable 属性中添加部分名称以提高可读性。

//
//MARK: - Badge
//
@IBInspectable
var badgeColor:UIColor = UIColor.darkGray {
didSet {
updateView()
}
}

@IBInspectable
var showBadgeOnIndex:Int = 0 {
didSet {
if showBadgeOnIndex >= buttons.count {
showBadgeOnIndex = 0
}
updateView()
}
}

@IBInspectable
var showAllBadge:Bool = false {
didSet {
updateView()
}
}

@IBInspectable
var hideAllBadge:Bool = true {
didSet {
updateView()
}
}

例如:

Example attributes in the Attributes inspector

在上图中, View 属性的部分名称为View

如有任何帮助,我们将不胜感激。

我已经知道自定义类的名称将在属性检查器中显示为部分名称。

最佳答案

属性检查器中的部分及其标题是根据该部分中的属性所属的确切类生成的。 没有办法改变这种行为。

但是,Xcode 会自动将具有相似名称的可检查属性分组。这些组用一条线分隔。此行为在您的示例图片中也可见:

separator between automatically created groups

关于ios - 如何在 Xcode 的属性检查器中添加部分名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47770995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com