I would like my struct to print its entries by alphabetical order first then arrange the data from descending order way. So the final result should be “lukes 9”, “lukes 4”, “smiths 4”
struct MyData {
var company = String();
var score:Int;
}
let data = [
MyData(company: "smiths", score: 4 ),
MyData(company: "lukes", score: 4),
MyData(company: "lukes", score: 9)
]