I load a value from a dictionary in a plist but when I print it to the console, it prints: Optional(Monday Title) rather than just \"Monday Title\".
How can I get ri
With some try, I think this way is better.
(variableName ?? "default value")!
Use ?? for default value and then use ! for unwrap optional variable.
Here is example,
var a:String? = nil
var b:String? = "Hello"
print("varA = \( (a ?? "variable A is nil.")! )")
print("varB = \( (b ?? "variable B is nil.")! )")
It will print
varA = variable A is nil.
varB = Hello