I have Dataset structure defined as
struct Dataset: Hashable {
var x: Double
var y: Double
}
and then array
var dataset: [Dataset]
array is filled with values and I need to find max values for both x and y struct vars. Is use of
let maxXValue = dataset.max(by: (Dataset, Dataset) throws -> Bool)
right approach and how it should look then?