I am getting a compile error saying
Bound value in a conditional binding must be an Optional type
Below is a screenshot of the code
You can convert the value of array[index] to an Optional doing something like this:
if let value = Int?(array[index]){
result += value
}
That's if your array contains Ints. You could also use AnyObject?, but you'll get a warning from xcode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With