我有以下结构:
struct Subject{
let subjectId : String
let subjectName : String
let room : String
let startTime : String
let endTime : String
}
包含以下数据的数组
var subjects = [Subject(subjectId: "xQsfz", subjectName: "Math", room: "Room 10", startTime: "10:20", endTime: "11:20"),Subject(subjectId: "yHsPz", subjectName: "Physics", room: "Room 5", startTime: "9:10", endTime: "10:19")]
如何按" startTime"?
对数组主题进行排序我发现它很难,因为startTime是String类型(由于它不能是Integer),所以我们都很感激各种帮助!