티스토리 뷰

filter 메서드를 사용하여 해당 menuList 배열을 섹션별로 빠르게 필터링 할 수 있습니다. 다음과 같이 표시됩니다. let sectionZero = menuList.filter { (model) -> Bool in return model.section == 0 } let sectionOne = menuList.filter { (model) -> Bool in return model.section == 1 }

menuList 및 tableView를 자주 다시로드하는 경우 고통 스러울 수 있지만 다차원 배열을 원하지 않는 경우 가능합니다.



출처
https://stackoverflow.com/questions/39920005
댓글
공지사항
Total
Today
Yesterday
«   2025/07   »
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 29 30 31