Swift error: 'missing return in function'?

前端 未结 4 1725
无人共我
无人共我 2020-12-11 18:35

I am creating a tic tac toe game and I came upon this error that I don\'t really understand: \"Missing return in a function expected to return \'(location:String, pattern:St

4条回答
  •  [愿得一人]
    2020-12-11 19:10

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        let button = DropDownButton()
        switch button {
        case userButton:
            return userButton.dropView.dropDownOptions.count
        case categoryButton:
            return categoryButton.dropView.dropDownOptions.count
        default:
            return 0
        }
    

提交回复
热议问题