I'm working on an app and I need to know something, because I cannot continue without a solution to my problem. I have an array of the following type:
var samples : [HKSample?]!
Now I want to know if this array contains a specific element and what's the index of that element. When I'm trying to get the index like this
let anotherSample : HKSample = otherSamples.first
let index = samples.indexOf(anotherSample)
I get the following error:
"Cannot convert value of type 'HKSample?' to expected argument type '@noescpae (HKSample?) throws -> Bool'
Please help me!