[swift4] Start to rotate indicator on Selected Tableview Cell

How to start to rotate indicator on Selected Tableview Cell, is below code

Get cell data by “tableView.cellForRow(at: indexPath)”, then get indicate data via tag number from cell data.

Start to rotate indicate with .startAnimating()

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        let cell = tableView.cellForRow(at: indexPath)
        let indicator = cell?.contentView.viewWithTag(1) as! UIActivityIndicatorView
        indicator.startAnimating()

    }

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です