You can combine multiple if clauses into a single level!
if let oneCheck = optionalOne,
let twoCheck = optionalTwo,
oneCheck > 0 || twoCheck > 0 {
// …
}
ETA: though it’s worth noting, your two examples aren’t actually equivalent—the version I’ve posted here only satisfies the condition if both optional shave a value, at least one of which is greater than 0, but your first example will satisfy the condition if at least one of the optional has a value and is greater than 0, which is subtly different behavior.
var v: Int? = nil
func test() {
v == 0 // can do this
v != 0 // and this
v > 0 // but not that?
// Error: Value of optional type 'Int?' must be unwrapped to a value of type 'Int'
}
The reason there is no such operator is that it was removed from Swift in version 3. At the time, conditional conformances were not possible, but the principal reason for the removal of these operators stands even today:
If nil can be compared with non-nil, then it has to be either less than any non-nil value or greater than every non-nil value (or else it breaks the semantic guarantees of Comparable like NaN, which we very much wouldn’t want to do)—either choice can cause non-intuitive behavior in generic contexts when users do not anticipate optional promotion.