"bonusCardsArray"の "BonusCard"の複数の配列を "currentPoints"値に基づいてソート(降順、昇順)する方法を教えてください。所定の位置に並べ替えるにSwift 3 sort jsonArray
//Array to sort according to "currentPoints"
var bonusCardsArray = [BonusCard]()
//basis class
class BonusCard {
var companyName : String
var bonusCardDescription : String
var currentPoints : Int
var bonusCardType : Int
init(companyName: String, bonusCardDescription: String,
currentPoints: Int, bonusCardType: Int) {
self.companyName = companyName
self.bonusCardDescription = bonusCardDescription
self.currentPoints = currentPoints
self.bonusCardType = bonusCardType
}
}
ありがとう、仲間。 1ライナーがそんなに多くをすることができると想像できませんでした:-) – Jim