iOS Swift - Lists and Data Display
Identify the error in this Swift code for empty state handling:
var data: [String]?
if data.isEmpty {
print("No data")
}var data: [String]?
if data.isEmpty {
print("No data")
}data is an optional array ([String]?), meaning it can be nil.isEmpty directly on an optional without unwrapping it first.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions