You could use the ternary operator to convert a Bool to Int:
let result = condition ? 1 : 0
result will be 1 if condition is true, 0 is condition is false.
You could use the ternary operator to convert a Bool to Int:
let result = condition ? 1 : 0
result will be 1 if condition is true, 0 is condition is false.