[Swift4] TableView의 특정 줄만 다시 불러오는 reloadRows 방법에 대해 조사를 진행했습니다.
방법 let indexPath = IndexPath(row: 1, section: 0)
tableView.reloadRows(at: [indexPath], with: .fade)
reloadRows(at:with:) - UITableView | Apple Developer Documentation
해설
첫 번째 매개변수at:[indexPath]
다시 불러올 줄을 지정합니다.
NSIndexPath 객체는 여러 줄을 지정할 수 있습니다.let indexPath_1 = IndexPath(row: 1, section: 0)
let indexPath_2 = IndexPath(row: 2, section: 0)
tableView.reloadRows(at: [indexPath_1, indexPath_2], with: .fade)
NSIndexPath - Foundation | Apple Developer Documentation
두 번째 매개변수 with:.fade
다시 불러올 때 애니메이션하는 방식을 지정합니다.
애니메이션은 TableView 클래스에서 다음과 같이 정의되는 몇 가지 유형이 있습니다.public enum RowAnimation : Int {
case fade
case right // slide in from right (or out to right)
case left
case top
case bottom
case none // available in iOS 3.0
case middle // available in iOS 3.2. attempts to keep cell centered in the space it will/did occupy
case automatic // available in iOS 5.0. chooses an appropriate animation style for you
}
차이를 보기 위해 reload 버튼을 누르면 TableView 위에 다섯 줄이 다시 불러오는 샘플을 만듭니다.
.fade
자주 보는 무거운 짐인 것 같아서요.
.right
왼쪽에서 오른쪽으로 무거운 짐을 싣다.
.bottom
위에서 아래로 무거운 짐이 필요하다.
생각보다 확연히 다르고 재미있지만 평소 사용해도 나무랄 데가 없다.애니메이션이 없습니다.주변에 많은 것 같아요.
UITableView.RowAnimation - UITableView | Apple Developer Documentation
Reference
이 문제에 관하여([Swift4] TableView의 특정 줄만 다시 불러오는 reloadRows 방법에 대해 조사를 진행했습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/orimomo/items/be3453bc40f3279e7f69
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
let indexPath = IndexPath(row: 1, section: 0)
tableView.reloadRows(at: [indexPath], with: .fade)
첫 번째 매개변수at:[indexPath]
다시 불러올 줄을 지정합니다.
NSIndexPath 객체는 여러 줄을 지정할 수 있습니다.
let indexPath_1 = IndexPath(row: 1, section: 0)
let indexPath_2 = IndexPath(row: 2, section: 0)
tableView.reloadRows(at: [indexPath_1, indexPath_2], with: .fade)
NSIndexPath - Foundation | Apple Developer Documentation 두 번째 매개변수 with:.fade
다시 불러올 때 애니메이션하는 방식을 지정합니다.
애니메이션은 TableView 클래스에서 다음과 같이 정의되는 몇 가지 유형이 있습니다.
public enum RowAnimation : Int {
case fade
case right // slide in from right (or out to right)
case left
case top
case bottom
case none // available in iOS 3.0
case middle // available in iOS 3.2. attempts to keep cell centered in the space it will/did occupy
case automatic // available in iOS 5.0. chooses an appropriate animation style for you
}
차이를 보기 위해 reload 버튼을 누르면 TableView 위에 다섯 줄이 다시 불러오는 샘플을 만듭니다..fade
자주 보는 무거운 짐인 것 같아서요.
.right
왼쪽에서 오른쪽으로 무거운 짐을 싣다.
.bottom
위에서 아래로 무거운 짐이 필요하다.
생각보다 확연히 다르고 재미있지만 평소 사용해도 나무랄 데가 없다.애니메이션이 없습니다.주변에 많은 것 같아요.
UITableView.RowAnimation - UITableView | Apple Developer Documentation
Reference
이 문제에 관하여([Swift4] TableView의 특정 줄만 다시 불러오는 reloadRows 방법에 대해 조사를 진행했습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/orimomo/items/be3453bc40f3279e7f69텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)