소프트 임팩트 애니메이션 솔루션의 경우 :
스위프트 3 :
let indexPath = IndexPath(item: row, section: 0)
tableView.reloadRows(at: [indexPath], with: .fade)
Swift 2.x :
let indexPath = NSIndexPath(forRow: row, inSection: 0)
tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
앱이 충돌하지 않도록 보호하는 또 다른 방법입니다.
스위프트 3 :
let indexPath = IndexPath(item: row, section: 0)
if let visibleIndexPaths = tableView.indexPathsForVisibleRows?.index(of: indexPath as IndexPath) {
if visibleIndexPaths != NSNotFound {
tableView.reloadRows(at: [indexPath], with: .fade)
}
}
Swift 2.x :
let indexPath = NSIndexPath(forRow: row, inSection: 0)
if let visibleIndexPaths = tableView.indexPathsForVisibleRows?.indexOf(indexPath) {
if visibleIndexPaths != NSNotFound {
tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
}
}