I am trying to add code in cellForRowAt indexPath method like below
cell.itemNameLabel.text = nameArray[indexPath.row]
but it is showing error as Cannot assign value of type 'Any' to type 'String?'
so it can be solved by below 2 ways,
cell.fruitName.text = fruitArray[indexPath.row] as? String
or
cell.fruitName.text = (fruitArray[indexPath.row] as! String)
so, my question is what is the difference between 2 answers?