Is there a way to check strings for nil and \"\" in Swift? In Rails, I can use blank() to check.
nil
\"\"
blank()
I currently have this, but i
This is a general solution for all types that conform to the Collection protocol, which includes String:
Collection
String
extension Optional where Wrapped: Collection { var isNilOrEmpty: Bool { self?.isEmpty ?? true } }