Basically I want to print the below value as either "true", "false" or "nil". If I try just using the wrapped value I get the "nil" I want but gain the unwanted "Optional(true)" or "Optional(false). If I force unwrap the value and the value is nil I get a fatal error. I tried the below code as I've seen it work for Strings but because "nil" is not of type Bool it's not accepted. Any solutions to this?
var isReal: Bool?
String("Value is \(isReal ?? "nil")")
I'm exporting to a csv file and it's useful to know if this value is true or false or hasn't been checked yet.