为什么我的下面的ChoosePerson函数收到此警告?为什么不使用该功能?enter image description here
@IBAction func beginGameButton(_ sender: UIButton) {
**choosePerson()**. *Result of call to 'choosePerson()' is unused*
sender.isHidden = true
}
@IBAction func reveal(_ sender: UIButton) {
let picture = choosePerson().image
personImage.image = UIImage(named: picture)
}
func choosePerson() -> Family {
let chosenPerson = familyList.removeFirst()
questionLabel.text = chosenPerson.hint
return chosenPerson
}