iOS IndexPath section 0 row 0 으로 초기화하는 법
안녕하세요. 개발자 드리머즈입니다. 오랜만에 Xcode를 켜서 Swift 언어를 보니 엄청나게 어색하고 헷갈리네요.이번 포스팅에선 간단하게 section 0, row 0을 의미하는 IndexPath를 초기화 하는 코드를 보겠습니다. func scrollToTop() { let indexPath = IndexPath(row: 0, section: 0) tableView.scrollToRow(at: indexPath, at: UITableViewScrollPosition.top, animated: true)} 저는 tableView의 첫행으로 갈 때 사용할 함수로 scrollToTop을 정의했습니다.여기서 let indexPath = IndexPath(row: 0, section: 0)의 코드를 사용해 in..