Hi I'm trying to convert string to Int in the below code: How Can I change the below code that converts string to Int so that the app doesn't crash?
cell!.shouldEnableLikeButton(false)
let liked: Bool = cell!.likeButton.selected
cell?.setLikeStatus(liked)
let originalButtonTitle = cell?.likeLabel!.text
var likeCount: Int = originalButtonTitle!.toInt()! //This is where I get the error.. how can this be changed?
if liked {
likeCount += 1
} else {
likeCount -= 1
}
cell!.likeLabel.text = "\(likeCount)"