SyntaxFix
Write A Post
Hire A Developer
Questions
Instead of if, ternary operator might come handy when you want to get a value based on whether something is nil:
if
func f(x: String?) -> String { return x == nil ? "empty" : "non-empty" }