Xcode中的调用函数问题

时间:2018-07-11 19:39:42

标签: swift

为什么我的下面的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
}

0 个答案:

没有答案