I'm trying to write the following block of code in a single if let line:
if let amount = datasource?.incrementForCount?(count) {
count += amount
}
else if let amount = datasource?.fixedIncrement {
count += amount
}
when I try something like:
if let amount = datasource?.incrementForCount?(count) || let amount = datasource?.fixedIncrement {
count += amount
}
I got a compile time error.
I don't think that where clause is possible for this case.
Is it possible to combine the two if let statements into a single ORed one?