Created
February 11, 2018 17:36
-
-
Save sallySalem/8564deebd3fd9c109d8008127ec849ff to your computer and use it in GitHub Desktop.
Sort a list of custom object in Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sort Descending | |
customList.sortByDescending(CustomModel::date) | |
.apply { | |
view?.loadCustomList() | |
} | |
//Sort Ascending | |
customList.sortBy(CustomModel::date) | |
.apply { | |
view?.loadCustomList() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment