I have the following structure:
struct Subject{
let subjectId : String
let subjectName : String
let room : String
let startTime : String
let endTime : String
}
And an array containing the following data
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")]
How do I sort the array subjects by "startTime"?
I find it quite difficult because the startTime is of type String (due to the fact that it cant be Integer), every kind of help is appreciated!