Perfect-CRUD
Perfect-CRUD copied to clipboard
Investigate optional property comparison operators.
struct Foo {
let d: Double?
}
…where(\Foo.d < 5.0)…
The above gives a compilation error. Work around is:
…where(\Foo.d! < 5.0)…
While Swift won't technically let you do a comparison with an unwrapped optional:
var d: Double? = 4.0
d < 5.0
error: repl.swift:5:3: error: binary operator '<' cannot be applied to operands of type 'Double?' and 'Double'
d < 5.0
~ ^ ~~~
it's ok in SQL. Look into making this work without the "force unwrap" of the property. (It's not actually force unwrapping.)