Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- joined()
- suffix()
- Segue
- IOS
- API
- prefix()
- 알고리즘
- github
- 클론코딩
- BackgroundModes
- 코딩테스트
- uikit
- components()
- tableView
- swift
- replacesubrange()
- MVC
- reduce()
- Autolayout
- 프로그래머스
- 코드업 파이썬 기초 100제
- xocde
- GIT
- 싱글톤
- variadic parameters
- alamofire
- String()
- 대문자소문자
- 라이징캠프
- zip()
Archives
- Today
- Total
Daeng iOS
[iOS/Swift] Model 안의 멤버변수로 배열 정렬하기 본문
영화 검색 api 를 불러왔을 때 있는 별점(userRating)을 기준으로 내림차순 해봤다!
객체 안에 멤버변수로는 title, image, director, actor, userRating이 존재한다.
self.list = list.sorted(by: {$0.userRating > $1.userRating})
💡 결과

'IOS > Swift' 카테고리의 다른 글
| [Swift] zip(_:_:)에 대하여.. (0) | 2024.05.22 |
|---|---|
| [Swift] suffix(_:)에 대하여.. (0) | 2024.05.17 |
| [Swift] prefix(_:)에 대하여.. (0) | 2024.05.17 |
| [Swift] joined(separator:)에 대해.. (0) | 2024.05.09 |
| [Swift] 고차함수 map(_:)에 대해.. (0) | 2024.05.07 |