我有一个结构存储触及的最后三个UISlider
。这些是在另一个类(我的ViewController
)中定义的。
这是结构:
struct lastSlider {
var current: UISlider!
var previous: UISlider!
var previousprevious: UISlider!
mutating func setCurrent(slider: UISlider) {
if slider != current {
//push into stack
previousprevious = previous
previous = current
current = slider
}
}
出于调试目的,我希望能够确定哪些UISliders是lastSlider.current
等。
我尝试过简单地打印他们的.debugDescription
,但这只会向我提供有关他们的信息,而不是他们的名字。
如何识别UISlider
进行调试?
答案 0 :(得分:0)
正如@crizzis所写:
如何使用标签? developer.apple.com/documentation/uikit/uiview/1622493-tag
这解决了我的问题!