我的主页上有两个按钮作为左右箭头,每次点击一个按钮,UILabel都会通过数组更新,例如 let names = ["John, Smith, "Ahmed", "Jack", "Kathy"]
. 我有两个UIActions作为rightArrowClicked和leftArrowClicked . 最初,标签应显示为John,禁用左箭头,'ll be done by the isHidden property of leftArrow and likewise when the value is Kathy then rightArrow should be disabled. Along with that i also need to update another label w.r.t to the name value e.g john can have a value of 816167 , and kathy as 816168 and these values are coming from an external library which i' ve通过 cocoapods
添加,这是在该类的功能中生成的 . 任何想法我会怎么做?
2 回答
这是您需要的具有简单逻辑的代码
您可以尝试如下,并在viewDidLoad方法中调用updateButtonsState()