Array extension for sorting with a given priority values (direct & reverse)
let unsorted = ["age", "country", "middleName", "height", "weight", "name", "lastName"]
let shouldBeOutputFirst = ["name", "lastName", "age"]
let sorted = unsorted.sort(alwaysFirst : shouldBeOutputFirst)
// output ["name", "lastName", "age", "country", "middleName", "height", "weight"]
let unsorted = ["age", "country", "middleName", "height", "weight", "name", "lastName"]
let shouldBeAtTheEnd = ["name", "lastName", "age"]
let sorted = unsorted.sort(alwaysLast : shouldBeAtTheEnd)
// output ["country", "middleName", "height", "weight", "age", "lastName", "name"]