Swift проверьте, пуст ли массив
// array with elements
let numbers = [21, 33, 59, 17]
print("Numbers: \(numbers)")
// check if numbers is empty
var result = numbers.isEmpty
print("Is numbers empty? : \(result)")
// array without elements
let evenNumbers = [Int]()
print("Even Numbers: \(evenNumbers)")
// check if evenNumbers is empty
result = evenNumbers.isEmpty
print("Is evenNumbers empty? : \(result)")
SAMER SAEID