Imagine this, you have a class and enum like:
1 2 3 4 5 6 7 8 |
class UserDto { public var username: String public var userStatus: UserStatusDto } enum UserStatusDto: String { case ok = "Ok" case error = "Error" } |
and you want to sort users by their status, but users with error first. How to do that? Continue reading