Imagine this, you have a class and enum like:
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