[iOS] indexPath.row , IndexPath.item 의 차이점
강의를 듣다가 문득 CollectionView나 TableView의 cell을 나타낼때, indexPath.row / indexPath.item 나눠 사용하는 코드를 봤는데 무슨 차이일까 궁금해서 공부를 해봤습니다. 가시죱 거기에 대한 답변이 잘나와있는 부분을 가져왔어요. 밑줄친 내용을 보면 가독성을 위해 나누어 놨다고 이해하면 되겠네요. 스타일상 UICollectionView에서는 item을, UITableView에서는 row를 사용하는게 더 깔끔한 방식이긴 합니다. (암묵적인 약속..) 하지만 tableview에서 item을 사용해도, collectionview에서 row를 사용해도 아무 문제 없습니다. 참고 1. https://developer.apple.com/forums/thread/123050..
iOS
2022. 6. 22. 15:57
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- ios
- Swift 프로퍼티
- Swift 내림차순
- Swift joined
- Combine: Asynchronous Programming with Swift
- CS 네트워크
- Swift Error Handling
- swift 고차함수
- Swift init
- Swift Leetcode
- RTCCameraVideoCapturer
- removeLast()
- swift property
- Swift ModernRIBs
- Swift joined()
- iOS error
- 2023년 회고
- Swift final
- swift protocol
- swift (programmers)
- Swift
- swift reduce
- Swift 알고리즘
- Swift RIBs
- Swift 프로그래머스
- swift programmers
- Class
- Swift inout
- RIBs tutorial
- 원티드 프리온보딩
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함